Skip to content

Commit

Permalink
- Fixing a bug in for-statements
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16278 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Leonardo Laguna committed Jun 10, 2013
1 parent b9420ab commit 8e965b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Compiler/Util/VarTransform.mo
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ algorithm
Absyn.Path fnName;
Option<DAE.Statement> ew,ew_1;
list<DAE.ComponentRef> conditions;
Boolean initialCall;
Boolean initialCall,iterIsArray;
Algorithm.Else el,el_1;
Integer ix;

Expand Down Expand Up @@ -698,15 +698,15 @@ algorithm
(xs_1,_) = replaceEquationsStmts(xs, repl,condExpFunc);
then
(DAE.STMT_IF(e_1,stmts2,el_1,source) :: xs_1,true);
case (((x as DAE.STMT_FOR(type_=tp,iterIsArray=b1,iter=id1,index=ix,range=e,statementLst=stmts,source = source)) :: xs),repl,condExpFunc)
case (((x as DAE.STMT_FOR(type_=tp,iterIsArray=iterIsArray,iter=id1,index=ix,range=e,statementLst=stmts,source = source)) :: xs),repl,condExpFunc)
equation
(stmts2,b1) = replaceEquationsStmts(stmts,repl,condExpFunc);
(e_1,b2) = replaceExp(e, repl, condExpFunc);
true = b1 or b2;
/* TODO: Add operation to source; do simplify? */
(xs_1,_) = replaceEquationsStmts(xs, repl,condExpFunc);
then
(DAE.STMT_FOR(tp,b1,id1,ix,e_1,stmts2,source) :: xs_1,true);
(DAE.STMT_FOR(tp,iterIsArray,id1,ix,e_1,stmts2,source) :: xs_1,true);
case (((x as DAE.STMT_WHILE(exp = e,statementLst=stmts,source = source)) :: xs),repl,condExpFunc)
equation
(stmts2,b1) = replaceEquationsStmts(stmts,repl,condExpFunc);
Expand Down

0 comments on commit 8e965b8

Please sign in to comment.