From dd798d688b7e9ea6c7d4d01aea976dde5ec75f60 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Thu, 1 Apr 2021 23:57:49 +0100 Subject: Fix #8919: Release builds with asserts enabled (#8925) --- src/3rdparty/squirrel/squirrel/sqstate.cpp | 4 ++-- src/3rdparty/squirrel/squirrel/sqvm.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/3rdparty/squirrel') 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); } -- cgit v1.2.3-70-g09d2