Skip to content

Commit

Permalink
Handle comparison of empty expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Feb 13, 2017
1 parent 03dd6d2 commit 54840e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Compiler/FrontEnd/Expression.mo
Expand Up @@ -12940,6 +12940,11 @@ algorithm
DAE.SHARED_LITERAL(index = i) := inExp2;
then Util.intCompare(inExp1.index, i);

case DAE.EMPTY()
algorithm
DAE.EMPTY(name=cr) := inExp2;
then ComponentReference.crefCompareGeneric(inExp1.name, cr);

else
algorithm
Error.addInternalError("Expression.compare failed: ctor:" + String(valueConstructor(inExp1)) + " " + printExpStr(inExp1) + " " + printExpStr(inExp2), sourceInfo());
Expand Down
4 changes: 4 additions & 0 deletions Compiler/FrontEnd/InstSection.mo
Expand Up @@ -3071,6 +3071,10 @@ algorithm
then
fail();

// Failed in graphics mode; just continue
case (cache,env,ih,sets,_,_,_,_,graph) guard Config.getGraphicsExpMode()
then (cache,env,ih,sets,DAE.emptyDae,graph);

case (_,_,_,_,_,c1,c2,_,_)
equation
true = Flags.isSet(Flags.FAILTRACE);
Expand Down

0 comments on commit 54840e0

Please sign in to comment.