diff options
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.215 2014/06/10 17:41:38 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.216 2014/06/10 18:51:21 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -970,10 +970,11 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, | |||
970 | ci->extra = savestack(L, c.func); | 970 | ci->extra = savestack(L, c.func); |
971 | ci->u.c.old_errfunc = L->errfunc; | 971 | ci->u.c.old_errfunc = L->errfunc; |
972 | L->errfunc = func; | 972 | L->errfunc = func; |
973 | if (L->allowhook) | 973 | if (L->allowhook) /* save original value of 'allowhook' */ |
974 | ci->callstatus |= CIST_OAH; /* save original value of 'allowhook' */ | 974 | ci->callstatus |= CIST_OAH; |
975 | /* mark that function may do error recovery */ | 975 | else |
976 | ci->callstatus |= CIST_YPCALL; | 976 | ci->callstatus &= ~CIST_OAH; |
977 | ci->callstatus |= CIST_YPCALL; /* function can do error recovery */ | ||
977 | luaD_call(L, c.func, nresults, 1); /* do the call */ | 978 | luaD_call(L, c.func, nresults, 1); /* do the call */ |
978 | ci->callstatus &= ~CIST_YPCALL; | 979 | ci->callstatus &= ~CIST_YPCALL; |
979 | L->errfunc = ci->u.c.old_errfunc; | 980 | L->errfunc = ci->u.c.old_errfunc; |