From 5cec030d4d38faa862f97565470f998635fb7e02 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 16 Sep 2014 20:06:05 +0000 Subject: (svn r26832) -Fix [Squirrel]: ensure instance variable of SQNativeClosure is properly initialized --- src/3rdparty/squirrel/squirrel/sqapi.cpp | 1 - src/3rdparty/squirrel/squirrel/sqclosure.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/3rdparty/squirrel/squirrel/sqapi.cpp b/src/3rdparty/squirrel/squirrel/sqapi.cpp index a1c91e567..37d4f0c79 100644 --- a/src/3rdparty/squirrel/squirrel/sqapi.cpp +++ b/src/3rdparty/squirrel/squirrel/sqapi.cpp @@ -357,7 +357,6 @@ SQRESULT sq_arrayinsert(HSQUIRRELVM v,SQInteger idx,SQInteger destpos) void sq_newclosure(HSQUIRRELVM v,SQFUNCTION func,SQUnsignedInteger nfreevars) { SQNativeClosure *nc = SQNativeClosure::Create(_ss(v), func); - nc->_nparamscheck = 0; for(SQUnsignedInteger i = 0; i < nfreevars; i++) { nc->_outervalues.push_back(v->Top()); v->Pop(); diff --git a/src/3rdparty/squirrel/squirrel/sqclosure.h b/src/3rdparty/squirrel/squirrel/sqclosure.h index f872f2b8d..a42dcd575 100644 --- a/src/3rdparty/squirrel/squirrel/sqclosure.h +++ b/src/3rdparty/squirrel/squirrel/sqclosure.h @@ -80,7 +80,7 @@ public: struct SQNativeClosure : public CHAINABLE_OBJ { private: - SQNativeClosure(SQSharedState *ss,SQFUNCTION func){_function=func;INIT_CHAIN();ADD_TO_CHAIN(&_ss(this)->_gc_chain,this); } + SQNativeClosure(SQSharedState *ss,SQFUNCTION func) : _nparamscheck(0) {_function=func;INIT_CHAIN();ADD_TO_CHAIN(&_ss(this)->_gc_chain,this); } public: static SQNativeClosure *Create(SQSharedState *ss,SQFUNCTION func) { -- cgit v1.2.3-70-g09d2