Skip to content

Commit

Permalink
- Fixed potential loop with simplifyAsub
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9686 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Aug 25, 2011
1 parent 9e3b3af commit 1bde1e3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Compiler/FrontEnd/ExpressionSimplify.mo
Expand Up @@ -2688,15 +2688,18 @@ algorithm
list<Subscript> s,s_1;
Integer n;
String idn;
list<DAE.Dimension> dims;
Integer ndim,nsub;

// simple name subscript
case (DAE.CREF_IDENT(idn,t2,s),sub)
equation
/* TODO: Make sure that the IDENT has enough dimensions? */
s_1 = Expression.subscriptsAppend(s, DAE.ICONST(sub));
c_1 = ComponentReference.makeCrefIdent(idn,t2,s_1);
then
c_1;

// qualified name subscript
case (DAE.CREF_QUAL(idn,t2,s,c),sub)
equation
Expand Down Expand Up @@ -2962,12 +2965,6 @@ algorithm
then
DAE.ARRAY(t_1,b,expl_1);

case ((e as DAE.CREF(componentRef = cr,ty = t)),sub)
equation
e_1 = Expression.makeASUB(e,{sub});
then
e_1;

case(e as DAE.IFEXP(cond,e1,e2),sub)
equation
e1_1 = simplifyAsub(e1, sub);
Expand Down

0 comments on commit 1bde1e3

Please sign in to comment.