diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-10-01 11:05:04 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-10-01 11:05:04 -0300 |
commit | b157f3546eddda96b8b4f5cd81f56d4ceed2c418 (patch) | |
tree | d1c401fa83dee3c9e5ecf6b7c0eb686dd01398d0 | |
parent | ab7086e209d49b6ff2593a7c97ddaed664a3960b (diff) | |
download | lua-b157f3546eddda96b8b4f5cd81f56d4ceed2c418.tar.gz lua-b157f3546eddda96b8b4f5cd81f56d4ceed2c418.tar.bz2 lua-b157f3546eddda96b8b4f5cd81f56d4ceed2c418.zip |
BUG: 'pcall' may not restore previous error function when
inside coroutines
-rw-r--r-- | ldo.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 2.106 2012/06/29 19:23:33 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.107 2012/08/28 18:30:45 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -403,7 +403,11 @@ static void finishCcall (lua_State *L) { | |||
403 | int n; | 403 | int n; |
404 | lua_assert(ci->u.c.k != NULL); /* must have a continuation */ | 404 | lua_assert(ci->u.c.k != NULL); /* must have a continuation */ |
405 | lua_assert(L->nny == 0); | 405 | lua_assert(L->nny == 0); |
406 | /* finish 'lua_callk' */ | 406 | if (ci->callstatus & CIST_YPCALL) { /* was inside a pcall? */ |
407 | ci->callstatus &= ~CIST_YPCALL; /* finish 'lua_pcall' */ | ||
408 | L->errfunc = ci->u.c.old_errfunc; | ||
409 | } | ||
410 | /* finish 'lua_callk'/'lua_pcall' */ | ||
407 | adjustresults(L, ci->nresults); | 411 | adjustresults(L, ci->nresults); |
408 | /* call continuation function */ | 412 | /* call continuation function */ |
409 | if (!(ci->callstatus & CIST_STAT)) /* no call status? */ | 413 | if (!(ci->callstatus & CIST_STAT)) /* no call status? */ |