summaryrefslogtreecommitdiff
path: root/src/3rdparty
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-05-27 23:59:51 +0000
committeryexo <yexo@openttd.org>2009-05-27 23:59:51 +0000
commit9bd64cf588a6915b2662df26ffb54c80d61bbd11 (patch)
treeac6849603cf23a380b5806d90e4d4070655885a6 /src/3rdparty
parentdf7786f7899edd54456b42ac12469c364a737457 (diff)
downloadopenttd-9bd64cf588a6915b2662df26ffb54c80d61bbd11.tar.xz
(svn r16454) -Fix (r16181, r16241): fix the try/catch bug fixed in r16181 and reintroduced in r16241 again, this time without breaking the regression test.
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp
index bed94bf6e..fb3785787 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp
@@ -749,7 +749,16 @@ common_call:
case OT_NATIVECLOSURE: {
bool suspend;
_suspended_target = ct_target;
- _GUARD(CallNative(_nativeclosure(clo), arg3, ct_stackbase, clo,suspend));
+ try {
+ _GUARD(CallNative(_nativeclosure(clo), arg3, ct_stackbase, clo,suspend));
+ } catch (...) {
+ _suspended = SQTrue;
+ _suspended_target = ct_target;
+ _suspended_root = ci->_root;
+ _suspended_traps = traps;
+ _suspend_varargs = ci->_vargs;
+ throw;
+ }
if(suspend){
_suspended = SQTrue;
_suspended_target = ct_target;