Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
[NF] Remove bad NFCeval optimization.
Browse files Browse the repository at this point in the history
- Removed the caching of record field bindings that are created from the
  record instance's binding. It's not safe and causes subscripts to be
  dropped in some cases, and the record instance's binding is cached now
  anyway.

Belonging to [master]:
  - #2767
  • Loading branch information
perost authored and OpenModelica-Hudson committed Nov 6, 2018
1 parent c54cb4b commit 0e4d8ee
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions Compiler/NFFrontEnd/NFCeval.mo
Expand Up @@ -492,17 +492,8 @@ algorithm
algorithm
exp := evalCref(rest_cr, Expression.EMPTY(ty), target);
exp := makeComponentBinding2(exp, InstNode.name(node));
binding := Binding.CEVAL_BINDING(exp, {node});

// TODO: If the cref has subscripts we can't cache the binding, since it
// will have been evaluated with regards to the subscripts. We
// should create the complete binding and cache it first, then
// subscript it.
if not ComponentRef.hasSubscripts(cref) then
InstNode.updateComponent(Component.setBinding(binding, component), node);
end if;
then
binding;
Binding.CEVAL_BINDING(exp, {node});

else NFBinding.EMPTY_BINDING;
end matchcontinue;
Expand Down

0 comments on commit 0e4d8ee

Please sign in to comment.