Changeset - r20554:4415c42f3954
[Not reviewed]
master
0 2 0
rubidium - 11 years ago 2013-07-11 17:29:51
rubidium@openttd.org
(svn r25585) -Fix [FS#5320]: [Squirrel] Stack overflow did not show an error, due to the stack to throw the error already being full
2 files changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/3rdparty/squirrel/squirrel/sqvm.cpp
Show inline comments
 
@@ -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);
src/3rdparty/squirrel/squirrel/sqvm.h
Show inline comments
 
@@ -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(HSQUIRRELV
 

	
 
#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(); \
0 comments (0 inline, 0 general)