diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-06-10 14:41:38 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-06-10 14:41:38 -0300 |
commit | 6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4 (patch) | |
tree | 77247f6bb46460afa33749cedfc841f22089f785 /ltests.c | |
parent | 35a6aad0d745d3acb9d5feb895f84a05ae8bf5ba (diff) | |
download | lua-6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4.tar.gz lua-6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4.tar.bz2 lua-6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4.zip |
new type lua_KFunction + no more 'lua_getctx'
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 20 |
1 files changed, 8 insertions, 12 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.169 2014/05/08 19:08:46 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.170 2014/05/13 19:40:28 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -980,7 +980,7 @@ static void pushcode (lua_State *L, int code) { | |||
980 | 980 | ||
981 | 981 | ||
982 | static int testC (lua_State *L); | 982 | static int testC (lua_State *L); |
983 | static int Cfunck (lua_State *L); | 983 | static int Cfunck (lua_State *L, int status, int ctx); |
984 | 984 | ||
985 | /* | 985 | /* |
986 | ** arithmetic operation encoding for 'arith' instruction | 986 | ** arithmetic operation encoding for 'arith' instruction |
@@ -1044,12 +1044,6 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
1044 | lua_CFunction func = lua_tocfunction(L1, getindex); | 1044 | lua_CFunction func = lua_tocfunction(L1, getindex); |
1045 | lua_pushnumber(L1, cast(size_t, func)); | 1045 | lua_pushnumber(L1, cast(size_t, func)); |
1046 | } | 1046 | } |
1047 | else if EQ("getctx") { | ||
1048 | int i = 0; | ||
1049 | int s = lua_getctx(L1, &i); | ||
1050 | pushcode(L1, s); | ||
1051 | lua_pushinteger(L1, i); | ||
1052 | } | ||
1053 | else if EQ("getfield") { | 1047 | else if EQ("getfield") { |
1054 | int t = getindex; | 1048 | int t = getindex; |
1055 | lua_getfield(L1, t, getstring); | 1049 | lua_getfield(L1, t, getstring); |
@@ -1326,10 +1320,12 @@ static int Cfunc (lua_State *L) { | |||
1326 | } | 1320 | } |
1327 | 1321 | ||
1328 | 1322 | ||
1329 | static int Cfunck (lua_State *L) { | 1323 | static int Cfunck (lua_State *L, int status, int ctx) { |
1330 | int i = 0; | 1324 | pushcode(L, status); |
1331 | lua_getctx(L, &i); | 1325 | lua_setglobal(L, "status"); |
1332 | return runC(L, L, lua_tostring(L, i)); | 1326 | lua_pushinteger(L, ctx); |
1327 | lua_setglobal(L, "ctx"); | ||
1328 | return runC(L, L, lua_tostring(L, ctx)); | ||
1333 | } | 1329 | } |
1334 | 1330 | ||
1335 | 1331 | ||