summaryrefslogtreecommitdiff
path: root/src/3rdparty/squirrel
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/squirrel')
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp1
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.h5
2 files changed, 5 insertions, 1 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp
index 9041c7986..c8f4db674 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp
@@ -107,6 +107,7 @@ SQVM::SQVM(SQSharedState *ss)
_errorhandler = _null_;
_debughook = _null_;
_can_suspend = false;
+ _in_stackoverflow = false;
_ops_till_suspend = 0;
ci = NULL;
INIT_CHAIN();ADD_TO_CHAIN(&_ss(this)->_gc_chain,this);
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.h b/src/3rdparty/squirrel/squirrel/sqvm.h
index 4b922c370..d272d152e 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.h
+++ b/src/3rdparty/squirrel/squirrel/sqvm.h
@@ -170,6 +170,7 @@ public:
SQBool _can_suspend;
SQInteger _ops_till_suspend;
+ SQBool _in_stackoverflow;
bool ShouldSuspend()
{
@@ -200,8 +201,10 @@ inline SQObjectPtr &stack_get(HSQUIRRELVM v,SQInteger idx){return ((idx>=0)?(v->
#define PUSH_CALLINFO(v,nci){ \
if(v->_callsstacksize == v->_alloccallsstacksize) { \
- if (v->_callsstacksize > 65535) {\
+ if (v->_callsstacksize > 65535 && !v->_in_stackoverflow) {\
+ v->_in_stackoverflow = true; \
v->Raise_Error(_SC("stack overflow"));\
+ v->CallErrorHandler(v->_lasterror);\
return false;\
}\
v->GrowCallStack(); \