From 6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 10 Jun 2014 14:41:38 -0300 Subject: new type lua_KFunction + no more 'lua_getctx' --- ltests.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index cc1f72e5..1ff5c5f0 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 2.169 2014/05/08 19:08:46 roberto Exp roberto $ +** $Id: ltests.c,v 2.170 2014/05/13 19:40:28 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -980,7 +980,7 @@ static void pushcode (lua_State *L, int code) { static int testC (lua_State *L); -static int Cfunck (lua_State *L); +static int Cfunck (lua_State *L, int status, int ctx); /* ** arithmetic operation encoding for 'arith' instruction @@ -1044,12 +1044,6 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { lua_CFunction func = lua_tocfunction(L1, getindex); lua_pushnumber(L1, cast(size_t, func)); } - else if EQ("getctx") { - int i = 0; - int s = lua_getctx(L1, &i); - pushcode(L1, s); - lua_pushinteger(L1, i); - } else if EQ("getfield") { int t = getindex; lua_getfield(L1, t, getstring); @@ -1326,10 +1320,12 @@ static int Cfunc (lua_State *L) { } -static int Cfunck (lua_State *L) { - int i = 0; - lua_getctx(L, &i); - return runC(L, L, lua_tostring(L, i)); +static int Cfunck (lua_State *L, int status, int ctx) { + pushcode(L, status); + lua_setglobal(L, "status"); + lua_pushinteger(L, ctx); + lua_setglobal(L, "ctx"); + return runC(L, L, lua_tostring(L, ctx)); } -- cgit v1.2.3-55-g6feb