diff options
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.14 2004/10/06 18:34:16 roberto Exp $ | 2 | ** $Id: ltests.c,v 2.15 2004/11/01 15:06:50 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 | */ |
@@ -200,7 +200,6 @@ static void checktable (global_State *g, Table *h) { | |||
200 | GCObject *hgc = obj2gco(h); | 200 | GCObject *hgc = obj2gco(h); |
201 | if (h->metatable) | 201 | if (h->metatable) |
202 | checkobjref(g, hgc, h->metatable); | 202 | checkobjref(g, hgc, h->metatable); |
203 | lua_assert(h->lsizenode || h->node == g->dummynode); | ||
204 | mode = gfasttm(g, h->metatable, TM_MODE); | 203 | mode = gfasttm(g, h->metatable, TM_MODE); |
205 | if (mode && ttisstring(mode)) { /* is there a weak mode? */ | 204 | if (mode && ttisstring(mode)) { /* is there a weak mode? */ |
206 | weakkey = (strchr(svalue(mode), 'k') != NULL); | 205 | weakkey = (strchr(svalue(mode), 'k') != NULL); |
@@ -542,8 +541,8 @@ static int table_query (lua_State *L) { | |||
542 | t = hvalue(obj_at(L, 1)); | 541 | t = hvalue(obj_at(L, 1)); |
543 | if (i == -1) { | 542 | if (i == -1) { |
544 | lua_pushinteger(L, t->sizearray); | 543 | lua_pushinteger(L, t->sizearray); |
545 | lua_pushinteger(L, sizenode(t)); | 544 | lua_pushinteger(L, t->node == &luaH_dummynode ? 0 : sizenode(t)); |
546 | lua_pushinteger(L, t->firstfree - t->node); | 545 | lua_pushinteger(L, t->lastfree - t->node); |
547 | } | 546 | } |
548 | else if (i < t->sizearray) { | 547 | else if (i < t->sizearray) { |
549 | lua_pushinteger(L, i); | 548 | lua_pushinteger(L, i); |