Skip to content

Commit c9a5da1

Browse files
committed
- fix bug #1993
handle negative start times. git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14539 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent e31c5c4 commit c9a5da1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Compiler/Script/CevalScript.mo

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,20 @@ algorithm
489489
Integer i; Real r;
490490
Absyn.Exp exp;
491491

492+
case (Absyn.UNARY(Absyn.SUB(),exp), _)
493+
equation
494+
DAE.ICONST(i) = getConst(exp, inExpType);
495+
i = intNeg(i);
496+
then
497+
DAE.ICONST(i);
498+
499+
case (Absyn.UNARY(Absyn.SUB(),exp), _)
500+
equation
501+
DAE.RCONST(r) = getConst(exp, inExpType);
502+
r = realNeg(r);
503+
then
504+
DAE.ICONST(r);
505+
492506
case (Absyn.INTEGER(i), DAE.T_INTEGER(source = _)) then DAE.ICONST(i);
493507
case (Absyn.REAL(r), DAE.T_REAL(source = _)) then DAE.RCONST(r);
494508

0 commit comments

Comments
 (0)