From 6b71a9cfe53040aa605f5d75c58a2124d03f8912 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 29 Jan 2001 15:17:26 -0200 Subject: smaller tables for machines with 8-bit alignment --- ltests.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index ff841472..60bb2ea4 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 1.58 2001/01/19 13:20:30 roberto Exp roberto $ +** $Id: ltests.c,v 1.59 2001/01/22 18:01:38 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -182,9 +182,12 @@ static int hash_query (lua_State *L) { } else { Hash *t; + Node n; + TObject *o = luaA_index(L, 1); luaL_checktype(L, 2, LUA_TTABLE); t = hvalue(luaA_index(L, 2)); - lua_pushnumber(L, luaH_mainposition(t, luaA_index(L, 1)) - t->node); + setobj2key(&n, o); + lua_pushnumber(L, luaH_mainposition(t, &n) - t->node); } return 1; } @@ -201,7 +204,9 @@ static int table_query (lua_State *L) { return 2; } else if (i < t->size) { - luaA_pushobject(L, &t->node[i].key); + TObject o; + setkey2obj(&o, &t->node[i]); + luaA_pushobject(L, &o); luaA_pushobject(L, &t->node[i].val); if (t->node[i].next) { lua_pushnumber(L, t->node[i].next - t->node); -- cgit v1.2.3-55-g6feb