Opened 10 years ago

Last modified 10 years ago

#2979 new defect

Underscores in function pointer names causes invalid generated code

Reported by: Per Östlund Owned by: Lennart Ochel
Priority: normal Milestone: Future
Component: Code Generation Version: trunk
Keywords: Cc:

Description (last modified by Per Östlund)

This model fails to compile, because in the generated code a variable called _func_ptr is declared and assigned, but _func__ptr is instead used when trying to call the function.

function f
  output Real x := 3;
end f;

function test
  output Real x;
protected
  partial function FuncType
    output Real x;
  end FuncType;

  FuncType func_ptr := f;
algorithm
  x := func_ptr();
end test;

Change History (2)

comment:1 by Per Östlund, 10 years ago

Description: modified (diff)

comment:2 by Martin Sjölund, 10 years ago

Component: BootstrappingCode Generation
Owner: changed from Martin Sjölund to Lennart Ochel

Moving this from the bootstrapping component; the same issue should occur for regular Modelica models.

Note: See TracTickets for help on using tickets.