new api_check that 'pcallk' cannot be called inside hooks
This commit is contained in:
4
lapi.c
4
lapi.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lapi.c,v 2.106 2009/12/22 15:32:50 roberto Exp roberto $
|
** $Id: lapi.c,v 2.107 2009/12/22 16:47:00 roberto Exp roberto $
|
||||||
** Lua API
|
** Lua API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -835,6 +835,8 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
|
|||||||
int status;
|
int status;
|
||||||
ptrdiff_t func;
|
ptrdiff_t func;
|
||||||
lua_lock(L);
|
lua_lock(L);
|
||||||
|
api_check(L, k == NULL || !isLua(L->ci),
|
||||||
|
"cannot use continuations inside hooks");
|
||||||
api_checknelems(L, nargs+1);
|
api_checknelems(L, nargs+1);
|
||||||
checkresults(L, nargs, nresults);
|
checkresults(L, nargs, nresults);
|
||||||
if (errfunc == 0)
|
if (errfunc == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user