Mercurial > hg > openttd
changeset 12047:777e9d7a1480 draft
(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.
author | yexo <yexo@openttd.org> |
---|---|
date | Wed, 27 May 2009 23:59:51 +0000 |
parents | da0c682ff327 |
children | 4a1df505252a |
files | src/3rdparty/squirrel/squirrel/sqvm.cpp |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp +++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp @@ -749,7 +749,16 @@ 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;