Skip to content

Commit

Permalink
-Fixed bug introduced in -r4876 (size({{1,2},{3,4}})) stopped working…
Browse files Browse the repository at this point in the history
…. Testcase for this exists in backend at MathCore.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4880 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Jan 28, 2010
1 parent 1b92464 commit 8e242dd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Compiler/Ceval.mo
Expand Up @@ -4123,13 +4123,17 @@ algorithm
Option<Interactive.InteractiveSymbolTable> st;
Msg msg;
Env.Cache cache;
Exp.Exp exp;
/* size(cr) */
case (cache,env,DAE.CREF(componentRef = cr,ty = tp),impl,st,msg)
equation
(cache,_,tp,_,_,_) = Lookup.lookupVar(cache,env, cr);
sizelst = Types.getDimensionSizes(tp);
v = ValuesUtil.intlistToValue(sizelst);
then
(cache,v,st);

/* For matrix expressions: [1,2;3,4] */
case (cache, env, DAE.MATRIX(ty = DAE.ET_ARRAY(arrayDimensions = dims)), impl, st, msg)
local
list<Option<Integer>> dims;
Expand All @@ -4138,6 +4142,15 @@ algorithm
v = ValuesUtil.intlistToValue(sizelst);
then
(cache, v, st);
/* For other matrix expressions e.g. on array form: {{1,2},{3,4}} */
case (cache,env,exp,impl,st,msg)
equation
(cache,v,st) = ceval(cache,env, exp, impl, st, NONE, msg);
tp = Types.typeOfValue(v);
sizelst = Types.getDimensionSizes(tp);
v = ValuesUtil.intlistToValue(sizelst);
then
(cache,v,st);
end matchcontinue;
end cevalBuiltinSizeMatrix;

Expand Down

0 comments on commit 8e242dd

Please sign in to comment.