diff options
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 1.58 2001/01/19 13:20:30 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.59 2001/01/22 18:01:38 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 | */ |
@@ -182,9 +182,12 @@ static int hash_query (lua_State *L) { | |||
182 | } | 182 | } |
183 | else { | 183 | else { |
184 | Hash *t; | 184 | Hash *t; |
185 | Node n; | ||
186 | TObject *o = luaA_index(L, 1); | ||
185 | luaL_checktype(L, 2, LUA_TTABLE); | 187 | luaL_checktype(L, 2, LUA_TTABLE); |
186 | t = hvalue(luaA_index(L, 2)); | 188 | t = hvalue(luaA_index(L, 2)); |
187 | lua_pushnumber(L, luaH_mainposition(t, luaA_index(L, 1)) - t->node); | 189 | setobj2key(&n, o); |
190 | lua_pushnumber(L, luaH_mainposition(t, &n) - t->node); | ||
188 | } | 191 | } |
189 | return 1; | 192 | return 1; |
190 | } | 193 | } |
@@ -201,7 +204,9 @@ static int table_query (lua_State *L) { | |||
201 | return 2; | 204 | return 2; |
202 | } | 205 | } |
203 | else if (i < t->size) { | 206 | else if (i < t->size) { |
204 | luaA_pushobject(L, &t->node[i].key); | 207 | TObject o; |
208 | setkey2obj(&o, &t->node[i]); | ||
209 | luaA_pushobject(L, &o); | ||
205 | luaA_pushobject(L, &t->node[i].val); | 210 | luaA_pushobject(L, &t->node[i].val); |
206 | if (t->node[i].next) { | 211 | if (t->node[i].next) { |
207 | lua_pushnumber(L, t->node[i].next - t->node); | 212 | lua_pushnumber(L, t->node[i].next - t->node); |