commit 8b5940e7ca6a1233b81d850411261c22f2a7a657
parent 1a3656e56eb1c873a4d74661eb44c96c07d662c1
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Tue, 10 Jun 2014 16:13:01 -0300
must also reset CIST_OAH if necessary (CallInfo is not a fresh one)
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/lapi.c b/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
** 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->u.c.old_errfunc = L->errfunc;
L->errfunc = func;
- if (L->allowhook)
- ci->callstatus |= CIST_OAH; /* save original value of 'allowhook' */
- /* mark that function may do error recovery */
- ci->callstatus |= CIST_YPCALL;
+ if (L->allowhook) /* save original value of 'allowhook' */
+ ci->callstatus |= CIST_OAH;
+ else
+ ci->callstatus &= ~CIST_OAH;
+ ci->callstatus |= CIST_YPCALL; /* function can do error recovery */
luaD_call(L, c.func, nresults, 1); /* do the call */
ci->callstatus &= ~CIST_YPCALL;
L->errfunc = ci->u.c.old_errfunc;