Skip to content

Commit

Permalink
[NF] Fix Ceval.evalComponentBinding with 'each'.
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2694
  • Loading branch information
perost authored and OpenModelica-Hudson committed Oct 4, 2018
1 parent 7fd4fbc commit 2e84817
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Compiler/NFFrontEnd/NFCeval.mo
Expand Up @@ -296,6 +296,7 @@ protected
list<Subscript> subs;
Variability var;
Option<Expression> start_exp;
Integer pcount;
algorithm
exp_origin := if Class.isFunction(InstNode.getClass(InstNode.parent(node)))
then ExpOrigin.FUNCTION else ExpOrigin.CLASS;
Expand Down Expand Up @@ -350,7 +351,8 @@ algorithm

// Apply subscripts from the cref to the binding expression as needed.
if evaluated then
exp := subscriptEvaluatedBinding(exp, cref, Binding.parentCount(binding), evalSubscripts);
pcount := if Binding.isEach(binding) then 1 else Binding.parentCount(binding);
exp := subscriptEvaluatedBinding(exp, cref, pcount, evalSubscripts);
end if;
end evalComponentBinding;

Expand Down

0 comments on commit 2e84817

Please sign in to comment.