Skip to content

Commit

Permalink
better fix for #3738
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Mar 2, 2016
1 parent 540ad84 commit dc5bdff
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Compiler/BackEnd/EvaluateFunctions.mo
Expand Up @@ -181,7 +181,7 @@ protected function evalFunctions_findFuncs "traverses the lhs and rhs exps of an
algorithm
(eqOut,tplOut) := matchcontinue(eqIn,tplIn)
local
Integer sizeL,sizeR,size,idx,oldSize;
Integer idx;
Boolean b1,b2,changed, changed1;
BackendDAE.Equation eq;
BackendDAE.EquationAttributes attr;
Expand All @@ -204,7 +204,7 @@ algorithm
changed = changed1 or changed;
addEqs = listAppend(addEqs1,addEqs);
addEqs = listAppend(addEqs2,addEqs);
eq = BackendDAE.EQUATION(lhsExp,rhsExp,source,attr);
eq = BackendEquation.generateEquation(lhsExp,rhsExp,source,attr);
//if changed then print("FROM EQ "+BackendDump.equationString(eqIn)+"\n");print("GOT EQ "+BackendDump.equationString(eq)+"\n"); end if;
then
(eq,(shared,addEqs,idx+1,changed));
Expand All @@ -215,7 +215,7 @@ algorithm
end if;
then
(eqIn,tplIn);
case(BackendDAE.COMPLEX_EQUATION(left=exp1, right=exp2, source=source, attr=attr, size=oldSize),_)
case(BackendDAE.COMPLEX_EQUATION(left=exp1, right=exp2, source=source, attr=attr),_)
equation
b1 = Expression.containFunctioncall(exp1);
b2 = Expression.containFunctioncall(exp2);
Expand All @@ -229,10 +229,7 @@ algorithm
addEqs = listAppend(addEqs1,addEqs);
addEqs = listAppend(addEqs2,addEqs);
shared = BackendDAEUtil.setSharedFunctionTree(shared, funcs);
sizeL = getScalarExpSize(lhsExp);
sizeR = getScalarExpSize(rhsExp);
size = intMin(intMax(sizeR,sizeL), oldSize);
eq = if intEq(size,0) then BackendDAE.EQUATION(lhsExp,rhsExp,source,attr) else BackendDAE.COMPLEX_EQUATION(size,lhsExp,rhsExp,source,attr);
eq = BackendEquation.generateEquation(lhsExp,rhsExp,source,attr);
//since tuple=tuple is not supported, these equations are converted into a list of simple equations
(eq,addEqs) = convertTupleEquations(eq,addEqs);
//if changed then print("FROM EQ "+BackendDump.equationString(eqIn)+"\n");print("GOT EQ "+BackendDump.equationString(eq)+"\n"); end if;
Expand Down

0 comments on commit dc5bdff

Please sign in to comment.