summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-09-16 21:14:18 +0000
committerrubidium <rubidium@openttd.org>2014-09-16 21:14:18 +0000
commit3c85109c492e2bb794a6f41c8b01bdab1f7984b1 (patch)
tree686a2536955fa5d73d6306ec017a516ba20ea7e8
parenta1d4148be565124e4e48251b78d91e7174d0f825 (diff)
downloadopenttd-3c85109c492e2bb794a6f41c8b01bdab1f7984b1.tar.xz
(svn r26842) -Codechange [Squirrel]: other simple cases of non-initialised instance variables
-rw-r--r--src/3rdparty/squirrel/squirrel/sqopcodes.h3
-rw-r--r--src/3rdparty/squirrel/squirrel/squserdata.h7
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp5
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);
}