summaryrefslogtreecommitdiff
path: root/src/3rdparty
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-04-01 23:57:49 +0100
committerGitHub <noreply@github.com>2021-04-01 23:57:49 +0100
commitdd798d688b7e9ea6c7d4d01aea976dde5ec75f60 (patch)
tree35dbd6e5a3c3288d098cd961315bc57ae79ce524 /src/3rdparty
parent2a9825b8dec9d5bb3f43e36fcaae735f505e81de (diff)
downloadopenttd-dd798d688b7e9ea6c7d4d01aea976dde5ec75f60.tar.xz
Fix #8919: Release builds with asserts enabled (#8925)
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/squirrel/squirrel/sqstate.cpp4
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp14
2 files changed, 9 insertions, 9 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqstate.cpp b/src/3rdparty/squirrel/squirrel/sqstate.cpp
index eaad6a3f7..8233ad178 100644
--- a/src/3rdparty/squirrel/squirrel/sqstate.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqstate.cpp
@@ -252,7 +252,7 @@ SQInteger SQSharedState::CollectGarbage(SQVM *vm)
SQVM *vms = _thread(_root_vm);
vms->Mark(&tchain);
-#ifndef NDEBUG
+#ifdef WITH_ASSERT
SQInteger x = _table(_thread(_root_vm)->_roottable)->CountUsed();
#endif
_refs_table.Mark(&tchain);
@@ -291,7 +291,7 @@ SQInteger SQSharedState::CollectGarbage(SQVM *vm)
t = t->_next;
}
_gc_chain = tchain;
-#ifndef NDEBUG
+#ifdef WITH_ASSERT
SQInteger z = _table(_thread(_root_vm)->_roottable)->CountUsed();
assert(z == x);
#endif
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp
index 5419c94cf..ad07ac512 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp
@@ -1460,7 +1460,7 @@ bool SQVM::DeleteSlot(const SQObjectPtr &self,const SQObjectPtr &key,SQObjectPtr
}
}
res = t;
- }
+ }
break;
default:
Raise_Error("attempt to delete a slot from a %s",GetTypeName(self));
@@ -1471,7 +1471,7 @@ bool SQVM::DeleteSlot(const SQObjectPtr &self,const SQObjectPtr &key,SQObjectPtr
bool SQVM::Call(SQObjectPtr &closure,SQInteger nparams,SQInteger stackbase,SQObjectPtr &outres,SQBool raiseerror,SQBool can_suspend)
{
-#ifndef NDEBUG
+#ifdef WITH_ASSERT
SQInteger prevstackbase = _stackbase;
#endif
switch(type(closure)) {
@@ -1482,13 +1482,13 @@ bool SQVM::Call(SQObjectPtr &closure,SQInteger nparams,SQInteger stackbase,SQObj
bool ret = Execute(closure, _top - nparams, nparams, stackbase,outres,raiseerror);
this->_can_suspend = backup_suspend;
return ret;
- }
+ }
break;
- case OT_NATIVECLOSURE:{
+ case OT_NATIVECLOSURE: {
bool suspend;
return CallNative(_nativeclosure(closure), nparams, stackbase, outres,suspend);
- }
+ }
break;
case OT_CLASS: {
SQObjectPtr constr;
@@ -1499,12 +1499,12 @@ bool SQVM::Call(SQObjectPtr &closure,SQInteger nparams,SQInteger stackbase,SQObj
return Call(constr,nparams,stackbase,temp,raiseerror,false);
}
return true;
- }
+ }
break;
default:
return false;
}
-#ifndef NDEBUG
+#ifdef WITH_ASSERT
if(!_suspended) {
assert(_stackbase == prevstackbase);
}