Skip to content

Commit

Permalink
[FE] catch a fail case
Browse files Browse the repository at this point in the history
  • Loading branch information
kabdelhak committed Apr 17, 2024
1 parent 3d35fe4 commit 2727ea8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions OMCompiler/Compiler/FrontEnd/Inline.mo
Expand Up @@ -697,11 +697,18 @@ algorithm
Boolean b;
case (e,(SOME(functionTree),_),source)
guard
Expression.isConstValue(inExp)
equation
e_1 = Ceval.cevalSimpleWithFunctionTreeReturnExp(inExp, functionTree);
source = ElementSource.addSymbolicTransformation(source,DAE.OP_INLINE(DAE.PARTIAL_EQUATION(e),DAE.PARTIAL_EQUATION(e_1)));
then (e_1,source,true);
Expression.isConst(inExp)
algorithm
try
e_1 := Ceval.cevalSimpleWithFunctionTreeReturnExp(inExp, functionTree);
source := ElementSource.addSymbolicTransformation(source,DAE.OP_INLINE(DAE.PARTIAL_EQUATION(e),DAE.PARTIAL_EQUATION(e_1)));
b := true;
else
e_1 := inExp;
source := inSource;
b := false;
end try;
then (e_1,source,b);
case (e,fns,source)
equation
(e_1,_) = Expression.traverseExpBottomUp(e,function forceInlineCall(fns=fns, visitedPaths=AvlSetPath.Tree.EMPTY()),{});
Expand Down

0 comments on commit 2727ea8

Please sign in to comment.