summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp
index b4ff85d95..dae5ff4a2 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp
@@ -195,14 +195,19 @@ bool SQVM::ObjCmp(const SQObjectPtr &o1,const SQObjectPtr &o2,SQInteger &result)
case OT_INSTANCE:
if(_delegable(o1)->_delegate) {
Push(o1);Push(o2);
- if(CallMetaMethod(_delegable(o1),MT_CMP,2,res)) break;
+ if(CallMetaMethod(_delegable(o1),MT_CMP,2,res)) {
+ if(type(res) != OT_INTEGER) {
+ Raise_Error(_SC("_cmp must return an integer"));
+ return false;
+ }
+ _RET_SUCCEED(_integer(res))
+ }
}
//continues through (no break needed)
default:
_RET_SUCCEED( _userpointer(o1) < _userpointer(o2)?-1:1 );
}
- if(type(res)!=OT_INTEGER) { Raise_CompareError(o1,o2); return false; }
- _RET_SUCCEED(_integer(res));
+ assert(0);
}
else{