Skip to content

Commit

Permalink
- Fixed stack overflow in ControlledTanks fluid test by qualifying re…
Browse files Browse the repository at this point in the history
…declares

  properly in SCodeFlatten. Also gets rids of some other error messages.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10097 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Oct 12, 2011
1 parent 10ceab4 commit 33d8fa6
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 122 deletions.
5 changes: 4 additions & 1 deletion Compiler/FrontEnd/SCodeFlattenRedeclare.mo
Expand Up @@ -561,6 +561,7 @@ algorithm
Env env;
SCodeEnv.Frame item_env;
SCodeEnv.ClassType cls_ty;
list<SCodeEnv.Redeclaration> redecls;

// no redeclares!
case ({}, _, _, _) then (inItem, inTypeEnv);
Expand All @@ -572,7 +573,9 @@ algorithm
// Merge the types environment with it's enclosing scopes to get the
// enclosing scopes of the classes we need to replace.
env = SCodeEnv.enterFrame(item_env, inTypeEnv);
env = List.fold(inRedeclares, replaceRedeclaredElementInEnv, env);
// Fully qualify the redeclares to make sure they can be found.
redecls = List.map1(inRedeclares, qualifyRedeclare, inVarEnv);
env = List.fold(redecls, replaceRedeclaredElementInEnv, env);
item_env :: env = env;
then
(SCodeEnv.CLASS(cls, {item_env}, cls_ty), env);
Expand Down

0 comments on commit 33d8fa6

Please sign in to comment.