Skip to content

Commit

Permalink
- bugfix for evaluateAnnotation, avoid infinite loop
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7317 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Dec 8, 2010
1 parent 0933ebd commit f57ad0f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Compiler/DAEUtil.mo
Expand Up @@ -2735,6 +2735,7 @@ algorithm
HashTable2.HashTable ht,ht1,ht2;
DAE.ComponentRef cr;
DAE.Exp e;
Option<DAE.VariableAttributes> dae_var_attr;
case (DAE.DAE({}),ht) then ht;
case (DAE.DAE((DAE.COMP(dAElist = sublist) :: rest)),ht)
equation
Expand All @@ -2748,8 +2749,9 @@ algorithm
ht2 = getParameterVars(DAE.DAE(rest),ht1);
then
ht2;
case (DAE.DAE(((DAE.VAR(componentRef = cr,kind=DAE.PARAM(),binding=SOME(e)))):: rest),ht)
case (DAE.DAE(((DAE.VAR(componentRef = cr,kind=DAE.PARAM(),variableAttributesOption=dae_var_attr))):: rest),ht)
equation
e = getStartAttrFail(dae_var_attr);
ht1 = BaseHashTable.add((cr,e),ht);
ht2 = getParameterVars(DAE.DAE(rest),ht1);
then
Expand Down Expand Up @@ -2830,6 +2832,10 @@ algorithm
equation
true = Expression.isConst(e);
then e;
case (e,_)
equation
{} = Expression.extractCrefsFromExp(e);
then e;
case (e,pv)
equation
((e1,(_,i))) = Expression.traverseExp(e,evaluateAnnotationTraverse,(pv,0));
Expand Down

0 comments on commit f57ad0f

Please sign in to comment.