diff options
| author | Alexander Gavrilov | 2012-06-17 15:48:32 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-06-17 16:14:14 +0400 |
| commit | 16ae6cb1fb06217e5b32f74ec72ce9fce1923b56 (patch) | |
| tree | dfa9b9fe2954794fbc645de22e1b0edfa1a42977 | |
| parent | eeaae916edc28baa065e277acde69b0674fd3fd2 (diff) | |
| download | dfhack-16ae6cb1fb06217e5b32f74ec72ce9fce1923b56.tar.gz dfhack-16ae6cb1fb06217e5b32f74ec72ce9fce1923b56.tar.bz2 dfhack-16ae6cb1fb06217e5b32f74ec72ce9fce1923b56.tar.xz | |
Fix lua bug: 'peaceful' unwind of yielded pcall doesn't restore errfunc.
I.e. if the pcall results in no error, but a yield happens inside it,
the active errfunc is not restored to its previous value.
| -rw-r--r-- | depends/lua/src/ldo.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/depends/lua/src/ldo.c b/depends/lua/src/ldo.c index d18e33cd..35d95ae4 100644 --- a/depends/lua/src/ldo.c +++ b/depends/lua/src/ldo.c @@ -402,6 +402,9 @@ static void finishCcall (lua_State *L) { int n; lua_assert(ci->u.c.k != NULL); /* must have a continuation */ lua_assert(L->nny == 0); + /* finish 'lua_pcallk' */ + if (ci->callstatus & CIST_YPCALL) + L->errfunc = ci->u.c.old_errfunc; /* finish 'lua_callk' */ adjustresults(L, ci->nresults); /* call continuation function */ |
