diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-01-04 16:17:51 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-01-04 16:17:51 -0200 |
| commit | cec25167d1dee22e63c4a8500cd5520e254339c5 (patch) | |
| tree | 6267424492eaadeb1ad0cea6a91f2bed2747cc2f | |
| parent | 1fd4c482a03770384b8cedae466c85dd3346205a (diff) | |
| download | lua-cec25167d1dee22e63c4a8500cd5520e254339c5.tar.gz lua-cec25167d1dee22e63c4a8500cd5520e254339c5.tar.bz2 lua-cec25167d1dee22e63c4a8500cd5520e254339c5.zip | |
new api_check that 'pcallk' cannot be called inside hooks
| -rw-r--r-- | lapi.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -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) |
