Skip to content

Commit

Permalink
Restrict collapse of arrays with same call on each element to previous
Browse files Browse the repository at this point in the history
This is because many models fail that use other calls, like pre.

Belonging to [master]:
  - OpenModelica/OMCompiler#2645
  • Loading branch information
rfranke authored and OpenModelica-Hudson committed Sep 13, 2018
1 parent 1fd1dd9 commit f9edf28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Compiler/BackEnd/BackendDAETransform.mo
Expand Up @@ -865,7 +865,7 @@ algorithm
(exp1::exps) := Expression.flattenArrayExpToList(e);
(cr1, call1) := match exp1
case DAE.CREF(componentRef=cr1) then (cr1, "");
case DAE.CALL(path=Absyn.IDENT(name=call1), expLst={DAE.CREF(componentRef=cr1)}) then (cr1, call1);
case DAE.CALL(path=Absyn.IDENT(name="previous"), expLst={DAE.CREF(componentRef=cr1)}) then (cr1, "previous");
else fail();
end match;
// Check that the first element starts at index [1,...,1]
Expand All @@ -881,7 +881,7 @@ algorithm
//DAE.CREF(componentRef=cr2) := exp;
(cr2, call2) := match exp
case DAE.CREF(componentRef=cr2) then (cr2, "");
case DAE.CALL(path=Absyn.IDENT(name=call2), expLst={DAE.CREF(componentRef=cr2)}) then (cr2, call2);
case DAE.CALL(path=Absyn.IDENT(name="previous"), expLst={DAE.CREF(componentRef=cr2)}) then (cr2, "previous");
else fail();
end match;
true := ndim==listLength(ComponentReference.crefLastSubs(cr2));
Expand Down

0 comments on commit f9edf28

Please sign in to comment.