Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 - fixed Bug [#1651]
 - added test case


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10543 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Willi Braun committed Nov 18, 2011
1 parent 114161f commit 56f15b7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Compiler/BackEnd/BackendDAEUtil.mo
Expand Up @@ -1226,7 +1226,7 @@ algorithm
bindExp = SOME(e), arryDim = dims, index = idx, source = src,
values = va, comment = c, flowPrefix = fp, streamPrefix = sp), cache, env, _)
equation
((e2, _)) = Expression.traverseExp(e, replaceCrefsWithValues, vars);
((e2, _)) = Expression.traverseExp(e, replaceCrefsWithValues, (vars, cr));
(_, v, _) = Ceval.ceval(cache, env, e2, false,NONE(), Ceval.NO_MSG());
then
BackendDAE.VAR(cr, vk, vd, ty, SOME(e), SOME(v), dims, idx, src, va, c, fp, sp);
Expand All @@ -1235,20 +1235,21 @@ algorithm
end calculateValue;

public function replaceCrefsWithValues
input tuple<DAE.Exp, BackendDAE.Variables> inTuple;
output tuple<DAE.Exp, BackendDAE.Variables> outTuple;
input tuple<DAE.Exp, tuple<BackendDAE.Variables, DAE.ComponentRef>> inTuple;
output tuple<DAE.Exp, tuple<BackendDAE.Variables, DAE.ComponentRef>> outTuple;
algorithm
outTuple := matchcontinue(inTuple)
local
DAE.Exp e;
BackendDAE.Variables vars;
DAE.ComponentRef cr;
case ((DAE.CREF(cr, _), vars))
DAE.ComponentRef cr, cr_orign;
case ((DAE.CREF(cr, _), (vars, cr_orign)))
equation
false = ComponentReference.crefEqualNoStringCompare(cr, cr_orign);
({BackendDAE.VAR(bindExp = SOME(e))}, _) = BackendVariable.getVar(cr, vars);
((e, _)) = Expression.traverseExp(e, replaceCrefsWithValues, vars);
((e, _)) = Expression.traverseExp(e, replaceCrefsWithValues, (vars, cr_orign));
then
((e, vars));
((e, (vars,cr_orign)));
case (_) then inTuple;
end matchcontinue;
end replaceCrefsWithValues;
Expand Down

0 comments on commit 56f15b7

Please sign in to comment.