Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 46d9c5b

Browse files
vrugeOpenModelica-Hudson
authored andcommitted
[BE] fixes for inStream
fixes if posetiveMax is called for constant Belonging to [master]: - #2623
1 parent 13b403f commit 46d9c5b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Compiler/BackEnd/BackendDAEOptimize.mo

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,11 @@ algorithm
173173
then
174174
if simplifyToZero then Expression.createZeroExpression(tp) else Expression.makePureBuiltinCall("max", {e, expr}, tp);
175175

176-
//positiveMax(-cref, eps) = -cref where variable is constant <= 0
177-
case DAE.CALL(path=Absyn.IDENT("$OMC$PositiveMax"),expLst={e, expr}) guard Expression.isNegativeOrZero(e)
176+
//positiveMax(cref, eps) = cref where cref >= 0
177+
case DAE.CALL(path=Absyn.IDENT("$OMC$PositiveMax"),expLst={e, expr}) guard Expression.isPositiveOrZero(e)
178178
then e;
179179

180+
// e.g. positiveMax(cref, eps) = max(cref,eps) = eps where cref < 0
180181
case DAE.CALL(path=Absyn.IDENT("$OMC$PositiveMax"),expLst={e, expr})
181182
//print("\nsimplifyInStreamWork: ");
182183
//print(ExpressionDump.printExpStr(inExp));

0 commit comments

Comments
 (0)