From 8b5940e7ca6a1233b81d850411261c22f2a7a657 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 10 Jun 2014 16:13:26 -0300 Subject: must also reset CIST_OAH if necessary (CallInfo is not a fresh one) --- lapi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lapi.c') diff --git a/lapi.c b/lapi.c index 36962cf3..f775b1df 100644 --- 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; -- cgit v1.2.3-55-g6feb