Skip to content

Commit

Permalink
Revert r15458 (causes stack overflows)
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15462 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Mar 4, 2013
1 parent 71b2bc4 commit 22c02d9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Compiler/FrontEnd/ComponentReference.mo
Expand Up @@ -2577,7 +2577,7 @@ algorithm
List.map1Flat(crefs,expandCref_impl,true);

// A simple cref without subscripts but array type.
case (DAE.CREF_IDENT(id, ty as DAE.T_ARRAY(ty = DAE.T_COMPLEX(varLst=varLst,complexClassType=ClassInf.RECORD(_)), dims = dims), {}),true)
case (DAE.CREF_IDENT(id, DAE.T_ARRAY(ty = ty as DAE.T_COMPLEX(varLst=varLst,complexClassType=ClassInf.RECORD(_)), dims = dims), {}),true)
equation
// Create a list of : subscripts to generate all elements.
subs = List.fill(DAE.WHOLEDIM(), listLength(dims));
Expand All @@ -2586,23 +2586,23 @@ algorithm
expandCrefLst(crefs,varLst,{});

// A simple cref without subscripts but array type.
case (DAE.CREF_IDENT(id, ty as DAE.T_ARRAY(dims = dims), {}),_)
case (DAE.CREF_IDENT(id, DAE.T_ARRAY(ty = ty, dims = dims), {}),_)
equation
// Create a list of : subscripts to generate all elements.
subs = List.fill(DAE.WHOLEDIM(), listLength(dims));
then
expandCref2(id, ty, subs, dims);

// A simple cref with subscripts and array type.
case (DAE.CREF_IDENT(id, ty as DAE.T_ARRAY(ty = DAE.T_COMPLEX(varLst=varLst,complexClassType=ClassInf.RECORD(_)), dims = dims), subs),true)
case (DAE.CREF_IDENT(id, DAE.T_ARRAY(ty = ty as DAE.T_COMPLEX(varLst=varLst,complexClassType=ClassInf.RECORD(_)), dims = dims), subs),true)
equation
// Use the subscripts to generate only the wanted elements.
crefs = expandCref2(id, ty, subs, dims);
then
expandCrefLst(crefs,varLst,{});

// A simple cref with subscripts and array type.
case (DAE.CREF_IDENT(id, ty as DAE.T_ARRAY(dims = dims), subs),_)
case (DAE.CREF_IDENT(id, DAE.T_ARRAY(ty = ty, dims = dims), subs),_)
// Use the subscripts to generate only the wanted elements.
then
expandCref2(id, ty, subs, dims);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/ConnectUtil.mo
Expand Up @@ -562,7 +562,7 @@ algorithm
ty = ty as DAE.T_ARRAY(dims = _)))
equation
dims = Types.getDimensions(ty);
cr = DAE.CREF_IDENT(name, ty, {});
cr = DAE.CREF_IDENT(name, DAE.T_REAL_DEFAULT, {});
crefs = expandArrayCref(cr, dims, {});
then
crefs;
Expand Down
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/Inst.mo
Expand Up @@ -14918,8 +14918,8 @@ algorithm

// Record constructors are different
// If it's a constant binding, all fields will already be bound correctly. Don't return a DAE.
case (cr,DAE.T_COMPLEX(complexClassType = ClassInf.RECORD(_)),(DAE.MOD(eqModOption = SOME(DAE.TYPED(e,SOME(_),DAE.PROP(_,DAE.C_CONST()),_,_)))),_,impl)
then DAEUtil.emptyDae;
case (cr,DAE.T_COMPLEX(complexClassType = ClassInf.RECORD(_)),(DAE.MOD(eqModOption = SOME(DAE.TYPED(e,_,DAE.PROP(_,DAE.C_CONST()),_,_)))),_,impl)
then DAEUtil.emptyDae;

// Special case if the dimensions of the expression is 0.
// If this is true, and it is instantiated normally, matching properties
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Util/HashTable6.mo
Expand Up @@ -87,7 +87,7 @@ algorithm
local
DAE.ComponentRef cr11,cr12,cr21,cr22;
case ((cr11,cr12),(cr21,cr22))
then ComponentReference.crefEqualNoStringCompare(cr11,cr21) and ComponentReference.crefEqualNoStringCompare(cr12,cr22);
then ComponentReference.crefEqual(cr11,cr21) and ComponentReference.crefEqual(cr12,cr22);
end matchcontinue;
end keyEqual;

Expand Down
4 changes: 2 additions & 2 deletions Compiler/Util/VarTransform.mo
Expand Up @@ -1071,12 +1071,12 @@ protected function addReplacementInv2 "function: addReplacementInv2
will update the rule.
"
input HashTable3.HashTable invHt;
input DAE.ComponentRef dst;
input DAE.ComponentRef src;
input DAE.ComponentRef dst;
output HashTable3.HashTable outInvHt;
algorithm
outInvHt:=
matchcontinue (invHt,dst,src)
matchcontinue (invHt,src,dst)
local
HashTable3.HashTable invHt_1;
list<DAE.ComponentRef> srcs;
Expand Down
1 change: 0 additions & 1 deletion Compiler/runtime/Print_rml.c
Expand Up @@ -48,7 +48,6 @@ void Print_5finit(void)

RML_BEGIN_LABEL(Print__saveAndClearBuf)
{
if (!buf) increase_buffer();
long handle = PrintImpl__saveAndClearBuf();
if (handle < 0)
RML_TAILCALLK(rmlFC);
Expand Down

0 comments on commit 22c02d9

Please sign in to comment.