(svn r26842) -Codechange [Squirrel]: other simple cases of non-initialised instance variables

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 10 years ago
parent a1d4148be5
commit 3c85109c49

@ -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;

@ -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

@ -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);
}

Loading…
Cancel
Save