diff options
-rw-r--r-- | ltests.c | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.233 2017/11/23 15:38:42 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.234 2017/12/07 18:51:39 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 | */ |
@@ -1255,6 +1255,10 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
1255 | msg = NULL; /* to test 'luaL_checkstack' with no message */ | 1255 | msg = NULL; /* to test 'luaL_checkstack' with no message */ |
1256 | luaL_checkstack(L1, sz, msg); | 1256 | luaL_checkstack(L1, sz, msg); |
1257 | } | 1257 | } |
1258 | else if EQ("rawcheckstack") { | ||
1259 | int sz = getnum; | ||
1260 | lua_pushboolean(L1, lua_checkstack(L1, sz)); | ||
1261 | } | ||
1258 | else if EQ("compare") { | 1262 | else if EQ("compare") { |
1259 | const char *opt = getstring; /* EQ, LT, or LE */ | 1263 | const char *opt = getstring; /* EQ, LT, or LE */ |
1260 | int op = (opt[0] == 'E') ? LUA_OPEQ | 1264 | int op = (opt[0] == 'E') ? LUA_OPEQ |
@@ -1434,8 +1438,17 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) { | |||
1434 | int n = getnum; | 1438 | int n = getnum; |
1435 | if (L1 != L) { | 1439 | if (L1 != L) { |
1436 | int i; | 1440 | int i; |
1437 | for (i = 0; i < n; i++) | 1441 | for (i = 0; i < n; i++) { |
1438 | lua_pushstring(L, lua_tostring(L1, -(n - i))); | 1442 | int idx = -(n - i); |
1443 | switch (lua_type(L1, idx)) { | ||
1444 | case LUA_TBOOLEAN: | ||
1445 | lua_pushboolean(L, lua_toboolean(L1, idx)); | ||
1446 | break; | ||
1447 | default: | ||
1448 | lua_pushstring(L, lua_tostring(L1, idx)); | ||
1449 | break; | ||
1450 | } | ||
1451 | } | ||
1439 | } | 1452 | } |
1440 | return n; | 1453 | return n; |
1441 | } | 1454 | } |