From b6911c177ddf3080a70a910b1d6b2aab288350e1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 10 Nov 2014 12:47:29 -0200 Subject: [PATCH] luaL_loadbuffer replaced by luaL_loadstring (to test luaL_loadstring) + 'rawgetp'/'rawsetp' added to C interpreter --- ltests.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ltests.c b/ltests.c index 9a8fb820..f79192f9 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 2.192 2014/11/02 19:19:04 roberto Exp roberto $ +** $Id: ltests.c,v 2.193 2014/11/07 18:07:17 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -1118,9 +1118,8 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { luaL_loadfile(L1, luaL_checkstring(L1, getnum)); } else if EQ("loadstring") { - size_t sl; - const char *s = luaL_checklstring(L1, getnum, &sl); - luaL_loadbuffer(L1, s, sl, s); + const char *s = luaL_checkstring(L1, getnum); + luaL_loadstring(L1, s); } else if EQ("newmetatable") { lua_pushboolean(L1, luaL_newmetatable(L1, getstring)); @@ -1201,6 +1200,14 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { int t = getindex; lua_rawgeti(L1, t, getnum); } + else if EQ("rawgetp") { + int t = getindex; + lua_rawgetp(L1, t, cast(void *, cast(size_t, getnum))); + } + else if EQ("rawsetp") { + int t = getindex; + lua_rawsetp(L1, t, cast(void *, cast(size_t, getnum))); + } else if EQ("remove") { lua_remove(L1, getnum); }