aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-01-04 16:17:51 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-01-04 16:17:51 -0200
commitcec25167d1dee22e63c4a8500cd5520e254339c5 (patch)
tree6267424492eaadeb1ad0cea6a91f2bed2747cc2f
parent1fd4c482a03770384b8cedae466c85dd3346205a (diff)
downloadlua-cec25167d1dee22e63c4a8500cd5520e254339c5.tar.gz
lua-cec25167d1dee22e63c4a8500cd5520e254339c5.tar.bz2
lua-cec25167d1dee22e63c4a8500cd5520e254339c5.zip
new api_check that 'pcallk' cannot be called inside hooks
-rw-r--r--lapi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lapi.c b/lapi.c
index 0d29807a..5f824547 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.106 2009/12/22 15:32:50 roberto Exp roberto $ 2** $Id: lapi.c,v 2.107 2009/12/22 16:47:00 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*/
@@ -835,6 +835,8 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
835 int status; 835 int status;
836 ptrdiff_t func; 836 ptrdiff_t func;
837 lua_lock(L); 837 lua_lock(L);
838 api_check(L, k == NULL || !isLua(L->ci),
839 "cannot use continuations inside hooks");
838 api_checknelems(L, nargs+1); 840 api_checknelems(L, nargs+1);
839 checkresults(L, nargs, nresults); 841 checkresults(L, nargs, nresults);
840 if (errfunc == 0) 842 if (errfunc == 0)