Skip to content

Commit

Permalink
[NF] Don't evaluate impure funcs in if-conditions.
Browse files Browse the repository at this point in the history
- Add check for impure functions in isNonConstantIfCondition.

Belonging to [master]:
  - OpenModelica/OMCompiler#2672
  • Loading branch information
perost authored and OpenModelica-Hudson committed Sep 19, 2018
1 parent b0af930 commit 9646ce4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Compiler/NFFrontEnd/NFCall.mo
Expand Up @@ -486,7 +486,7 @@ uniontype Call
output Boolean isImpure;
algorithm
isImpure := match call
case TYPED_CALL() then Function.isImpure(call.fn);
case TYPED_CALL() then Function.isImpure(call.fn) or Function.isOMImpure(call.fn);
else false;
end match;
end isImpure;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/NFFrontEnd/NFTyping.mo
Expand Up @@ -2798,7 +2798,7 @@ algorithm
then match Absyn.pathFirstIdent(fn.path)
case "Connections" then true;
case "cardinality" then true;
else false;
else Call.isImpure(exp.call);
end match;
else false;
end match;
Expand Down

0 comments on commit 9646ce4

Please sign in to comment.