must also reset CIST_OAH if necessary (CallInfo is not a fresh one)
This commit is contained in:
11
lapi.c
11
lapi.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lapi.c,v 2.215 2014/06/10 17:41:38 roberto Exp roberto $
|
** $Id: lapi.c,v 2.216 2014/06/10 18:51:21 roberto Exp roberto $
|
||||||
** Lua API
|
** Lua API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -970,10 +970,11 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
|
|||||||
ci->extra = savestack(L, c.func);
|
ci->extra = savestack(L, c.func);
|
||||||
ci->u.c.old_errfunc = L->errfunc;
|
ci->u.c.old_errfunc = L->errfunc;
|
||||||
L->errfunc = func;
|
L->errfunc = func;
|
||||||
if (L->allowhook)
|
if (L->allowhook) /* save original value of 'allowhook' */
|
||||||
ci->callstatus |= CIST_OAH; /* save original value of 'allowhook' */
|
ci->callstatus |= CIST_OAH;
|
||||||
/* mark that function may do error recovery */
|
else
|
||||||
ci->callstatus |= CIST_YPCALL;
|
ci->callstatus &= ~CIST_OAH;
|
||||||
|
ci->callstatus |= CIST_YPCALL; /* function can do error recovery */
|
||||||
luaD_call(L, c.func, nresults, 1); /* do the call */
|
luaD_call(L, c.func, nresults, 1); /* do the call */
|
||||||
ci->callstatus &= ~CIST_YPCALL;
|
ci->callstatus &= ~CIST_YPCALL;
|
||||||
L->errfunc = ci->u.c.old_errfunc;
|
L->errfunc = ci->u.c.old_errfunc;
|
||||||
|
|||||||
Reference in New Issue
Block a user