aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-11-10 12:47:29 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-11-10 12:47:29 -0200
commitb6911c177ddf3080a70a910b1d6b2aab288350e1 (patch)
tree1229c025d93c86343b468e01d935e150063dca7c
parent9212175ffb5db7f3281a51529521dd870ce81041 (diff)
downloadlua-b6911c177ddf3080a70a910b1d6b2aab288350e1.tar.gz
lua-b6911c177ddf3080a70a910b1d6b2aab288350e1.tar.bz2
lua-b6911c177ddf3080a70a910b1d6b2aab288350e1.zip
luaL_loadbuffer replaced by luaL_loadstring (to test luaL_loadstring)
+ 'rawgetp'/'rawsetp' added to C interpreter
-rw-r--r--ltests.c15
1 files 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 @@
1/* 1/*
2** $Id: ltests.c,v 2.192 2014/11/02 19:19:04 roberto Exp roberto $ 2** $Id: ltests.c,v 2.193 2014/11/07 18:07:17 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*/
@@ -1118,9 +1118,8 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
1118 luaL_loadfile(L1, luaL_checkstring(L1, getnum)); 1118 luaL_loadfile(L1, luaL_checkstring(L1, getnum));
1119 } 1119 }
1120 else if EQ("loadstring") { 1120 else if EQ("loadstring") {
1121 size_t sl; 1121 const char *s = luaL_checkstring(L1, getnum);
1122 const char *s = luaL_checklstring(L1, getnum, &sl); 1122 luaL_loadstring(L1, s);
1123 luaL_loadbuffer(L1, s, sl, s);
1124 } 1123 }
1125 else if EQ("newmetatable") { 1124 else if EQ("newmetatable") {
1126 lua_pushboolean(L1, luaL_newmetatable(L1, getstring)); 1125 lua_pushboolean(L1, luaL_newmetatable(L1, getstring));
@@ -1201,6 +1200,14 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
1201 int t = getindex; 1200 int t = getindex;
1202 lua_rawgeti(L1, t, getnum); 1201 lua_rawgeti(L1, t, getnum);
1203 } 1202 }
1203 else if EQ("rawgetp") {
1204 int t = getindex;
1205 lua_rawgetp(L1, t, cast(void *, cast(size_t, getnum)));
1206 }
1207 else if EQ("rawsetp") {
1208 int t = getindex;
1209 lua_rawsetp(L1, t, cast(void *, cast(size_t, getnum)));
1210 }
1204 else if EQ("remove") { 1211 else if EQ("remove") {
1205 lua_remove(L1, getnum); 1212 lua_remove(L1, getnum);
1206 } 1213 }