diff --git a/OMCompiler/Compiler/BackEnd/BackendDAEUtil.mo b/OMCompiler/Compiler/BackEnd/BackendDAEUtil.mo index 002a8f0fce5..37f673be5a6 100644 --- a/OMCompiler/Compiler/BackEnd/BackendDAEUtil.mo +++ b/OMCompiler/Compiler/BackEnd/BackendDAEUtil.mo @@ -9367,6 +9367,7 @@ algorithm end setFunctionTree; public function setEqSystEqs + "Set ordered equations of input equation system to given equations." input BackendDAE.EqSystem inSyst; input BackendDAE.EquationArray inEqs; output BackendDAE.EqSystem syst = inSyst; diff --git a/OMCompiler/Compiler/BackEnd/SymbolicJacobian.mo b/OMCompiler/Compiler/BackEnd/SymbolicJacobian.mo index 63710e62b69..26674039efb 100644 --- a/OMCompiler/Compiler/BackEnd/SymbolicJacobian.mo +++ b/OMCompiler/Compiler/BackEnd/SymbolicJacobian.mo @@ -464,6 +464,8 @@ protected function inputDerivativesUsedWork "author: Frenkel TUD 2012-10" output BackendDAE.EqSystem osyst; output BackendDAE.Shared outShared = inShared "unused"; output Boolean outChanged; +protected + Boolean hasFailed = false; algorithm (osyst, outChanged) := matchcontinue(isyst) local @@ -474,10 +476,15 @@ algorithm ((_, explst as _::_)) = BackendDAEUtil.traverseBackendDAEExpsEqns(orderedEqs, traverserinputDerivativesUsed, (BackendVariable.daeGlobalKnownVars(inShared), {})); s = stringDelimitList(List.map(explst, ExpressionDump.printExpStr), "\n"); Error.addMessage(Error.DERIVATIVE_INPUT, {s}); + hasFailed = true; then (BackendDAEUtil.setEqSystEqs(isyst, orderedEqs), true); else (isyst, inChanged); end matchcontinue; + + // Fail after error is displayed. + // We do it this way, because I was to lazy to rewrite all of this function. + if hasFailed then fail(); end if; end inputDerivativesUsedWork; protected function traverserinputDerivativesUsed "author: Frenkel TUD 2012-10"