From 8b1653135cf06edca587f19e88a6c9928f5e253e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Tue, 15 Nov 2011 09:44:12 +0000 Subject: [PATCH] - Avoid stack overflow in all CORBA calls git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10512 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Compiler/Main/Main.mo | 6 ++++++ Compiler/Util/Error.mo | 1 + 2 files changed, 7 insertions(+) diff --git a/Compiler/Main/Main.mo b/Compiler/Main/Main.mo index e4661e44821..c987227738c 100644 --- a/Compiler/Main/Main.mo +++ b/Compiler/Main/Main.mo @@ -265,6 +265,12 @@ algorithm str = stringAppend(str, Error.printMessagesStr()); then (true,str,isymb); + case (str,isymb) + equation + _=System.setStackOverflowSignal(false); + Error.addMessage(Error.STACK_OVERFLOW,{str}); + then + (true,"",isymb); end matchcontinue; end handleCommand; diff --git a/Compiler/Util/Error.mo b/Compiler/Util/Error.mo index 6ba12196a97..41accc12ab1 100644 --- a/Compiler/Util/Error.mo +++ b/Compiler/Util/Error.mo @@ -551,6 +551,7 @@ public constant Message UNFILLED_SLOT = MESSAGE(203, TRANSLATION(), ERROR(), "Function argument %s was not given by the function call, and does not have a default value."); public constant Message SAME_CONNECT_INSTANCE = MESSAGE(204, TRANSLATION(), WARNING(), "connect(%s, %s) connects the same connector instance! The connect equation will be ignored."); +public constant Message STACK_OVERFLOW = MESSAGE(205, SCRIPTING(), ERROR(), "Stack overflow occurred while evaluating %s"); public constant Message UNBOUND_PARAMETER_WITH_START_VALUE_WARNING = MESSAGE(499, TRANSLATION(), WARNING(), "Parameter %s has no value, and is fixed during initialization (fixed=true), using available start value (start=%s) as default value");