diff options
author | rubidium <rubidium@openttd.org> | 2014-09-16 20:06:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-09-16 20:06:05 +0000 |
commit | 5cec030d4d38faa862f97565470f998635fb7e02 (patch) | |
tree | c3cfa42a43b77569fe948f27b72cdd4d4606c354 /src | |
parent | ff880a420ded98cd0786bbc8a4ce01434b5e88ea (diff) | |
download | openttd-5cec030d4d38faa862f97565470f998635fb7e02.tar.xz |
(svn r26832) -Fix [Squirrel]: ensure instance variable of SQNativeClosure is properly initialized
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/squirrel/squirrel/sqapi.cpp | 1 | ||||
-rw-r--r-- | src/3rdparty/squirrel/squirrel/sqclosure.h | 2 |
2 files changed, 1 insertions, 2 deletions
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) { |