mirror of https://github.com/OpenTTD/OpenTTD
(svn r25585) -Fix [FS#5320]: [Squirrel] Stack overflow did not show an error, due to the stack to throw the error already being full
parent
56a899f4bd
commit
2d459b2fc0
|
@ -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);
|
||||
|
|
|
@ -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(); \
|
||||
|
|
Loading…
Reference in New Issue