Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 16ae6cb1fb06217e5b32f74ec72ce9fce1923b56 1 parent eeaae91
@angavrilov angavrilov authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  depends/lua/src/ldo.c
View
3  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 */
Please sign in to comment.
Something went wrong with that request. Please try again.