Skip to content

Commit

Permalink
fix for ticket:5133, make impure function calls be parameter expressions
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2671
  • Loading branch information
adrpo authored and OpenModelica-Hudson committed Sep 19, 2018
1 parent e941483 commit b0af930
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Compiler/NFFrontEnd/NFCall.mo
Expand Up @@ -343,8 +343,10 @@ uniontype Call
typed_args := matchedFunc.args;

args := {};
var := if Function.isImpure(func) or Function.isOMImpure(func) // if is impure, make it highest variability
then Variability.CONTINUOUS
// if is impure, make it a parameter expression
// see https://trac.openmodelica.org/OpenModelica/ticket/5133
var := if Function.isImpure(func) or Function.isOMImpure(func)
then Variability.PARAMETER
else Variability.CONSTANT;
for a in typed_args loop
(arg_exp, _, arg_var) := a;
Expand Down

0 comments on commit b0af930

Please sign in to comment.