summaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-06-10 14:41:38 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-06-10 14:41:38 -0300
commit6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4 (patch)
tree77247f6bb46460afa33749cedfc841f22089f785 /ltests.c
parent35a6aad0d745d3acb9d5feb895f84a05ae8bf5ba (diff)
downloadlua-github-6f6fd96e3bd2cc1f61291717aee9d89ea0180cd4.tar.gz
new type lua_KFunction + no more 'lua_getctx'
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c20
1 files changed, 8 insertions, 12 deletions
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));
}