From 3c85109c492e2bb794a6f41c8b01bdab1f7984b1 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 16 Sep 2014 21:14:18 +0000 Subject: (svn r26842) -Codechange [Squirrel]: other simple cases of non-initialised instance variables --- src/3rdparty/squirrel/squirrel/sqopcodes.h | 3 +-- src/3rdparty/squirrel/squirrel/squserdata.h | 7 +++---- src/3rdparty/squirrel/squirrel/sqvm.cpp | 5 +++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/3rdparty/squirrel/squirrel/sqopcodes.h b/src/3rdparty/squirrel/squirrel/sqopcodes.h index d20ef4f3f..a9e4a8743 100644 --- a/src/3rdparty/squirrel/squirrel/sqopcodes.h +++ b/src/3rdparty/squirrel/squirrel/sqopcodes.h @@ -92,8 +92,7 @@ struct SQInstructionDesc { struct SQInstruction { - SQInstruction(){}; - SQInstruction(SQOpcode _op,SQInteger a0=0,SQInteger a1=0,SQInteger a2=0,SQInteger a3=0) + SQInstruction(SQOpcode _op=_OP_SCOPE_END,SQInteger a0=0,SQInteger a1=0,SQInteger a2=0,SQInteger a3=0) { op = _op; _arg0 = (unsigned char)a0;_arg1 = (SQInt32)a1; _arg2 = (unsigned char)a2;_arg3 = (unsigned char)a3; diff --git a/src/3rdparty/squirrel/squirrel/squserdata.h b/src/3rdparty/squirrel/squirrel/squserdata.h index 8b6b43148..3bf1a9dba 100644 --- a/src/3rdparty/squirrel/squirrel/squserdata.h +++ b/src/3rdparty/squirrel/squirrel/squserdata.h @@ -4,7 +4,8 @@ struct SQUserData : SQDelegable { - SQUserData(SQSharedState *ss){ _delegate = 0; _hook = NULL; INIT_CHAIN(); ADD_TO_CHAIN(&_ss(this)->_gc_chain, this); } + SQUserData(SQSharedState *ss, SQInteger size){ _delegate = 0; _hook = NULL; INIT_CHAIN(); ADD_TO_CHAIN(&_ss(this)->_gc_chain, this); _size = size; _typetag = 0; +} ~SQUserData() { REMOVE_FROM_CHAIN(&_ss(this)->_gc_chain, this); @@ -13,9 +14,7 @@ struct SQUserData : SQDelegable static SQUserData* Create(SQSharedState *ss, SQInteger size) { SQUserData* ud = (SQUserData*)SQ_MALLOC(sizeof(SQUserData)+(size-1)); - new (ud) SQUserData(ss); - ud->_size = size; - ud->_typetag = 0; + new (ud) SQUserData(ss, size); return ud; } #ifndef NO_GARBAGE_COLLECTOR diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp index d76787ef3..464e57c72 100644 --- a/src/3rdparty/squirrel/squirrel/sqvm.cpp +++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp @@ -115,6 +115,11 @@ SQVM::SQVM(SQSharedState *ss) _can_suspend = false; _in_stackoverflow = false; _ops_till_suspend = 0; + _callsstack = NULL; + _callsstacksize = 0; + _alloccallsstacksize = 0; + _top = 0; + _stackbase = 0; ci = NULL; INIT_CHAIN();ADD_TO_CHAIN(&_ss(this)->_gc_chain,this); } -- cgit v1.2.3-70-g09d2