Skip to content

Commit

Permalink
- fix annoying bug for expand variables
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12891 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Sep 12, 2012
1 parent af238d5 commit 75d6677
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Compiler/BackEnd/BackendVariable.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1951,9 +1951,10 @@ algorithm
arr_2 = arrayUpdate(arr_1, n + 1, SOME(v));
then
BackendDAE.VARIABLE_ARRAY(n_1,newsize,arr_2);
case (BackendDAE.VARIABLE_ARRAY(numberOfElements = n,arrSize = size),_)
case (BackendDAE.VARIABLE_ARRAY(numberOfElements = n,arrSize = size,varOptArr = arr),_)
equation
print("- BackendVariable.vararrayAdd failed\nn: " +& intString(n) +& ", size: " +& intString(size) +& "\n");
print("- BackendVariable.vararrayAdd failed\nn: " +& intString(n) +& ", size: " +& intString(size) +& " arraysize: " +& intString(arrayLength(arr)) +& "\n");
Debug.execStat("vararrayAdd",BackendDAE.RT_CLOCK_EXECSTAT_BACKEND_MODULES);
then
fail();
case (_,_)
Expand Down Expand Up @@ -2678,7 +2679,7 @@ algorithm
equation
size1 = noe + needed;
true = intGt(size1,size);
expandsize = size1-size1;
expandsize = size1-size;
arr_1 = Util.arrayExpand(expandsize, arr, NONE());
then
BackendDAE.VARIABLES(hashvec,BackendDAE.VARIABLE_ARRAY(noe,size1,arr_1),bsize,n);
Expand Down

0 comments on commit 75d6677

Please sign in to comment.