From 2727ea89a20c593f30c606e66e39475970db7e04 Mon Sep 17 00:00:00 2001 From: kabdelhak Date: Wed, 17 Apr 2024 10:58:10 +0200 Subject: [PATCH] [FE] catch a fail case --- OMCompiler/Compiler/FrontEnd/Inline.mo | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/OMCompiler/Compiler/FrontEnd/Inline.mo b/OMCompiler/Compiler/FrontEnd/Inline.mo index 663f80acf0..8c594cadcb 100644 --- a/OMCompiler/Compiler/FrontEnd/Inline.mo +++ b/OMCompiler/Compiler/FrontEnd/Inline.mo @@ -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()),{});