diff options
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.16 2005/01/05 18:20:51 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.17 2005/01/14 14:19:42 roberto Exp $ |
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 | */ |
@@ -299,7 +299,7 @@ printf(">>> %d %s %02x\n", g->gcstate, luaT_typenames[o->gch.tt], o->gch.marke | |||
299 | switch (o->gch.tt) { | 299 | switch (o->gch.tt) { |
300 | case LUA_TUPVAL: { | 300 | case LUA_TUPVAL: { |
301 | UpVal *uv = gco2uv(o); | 301 | UpVal *uv = gco2uv(o); |
302 | lua_assert(uv->v == &uv->value); /* must be closed */ | 302 | lua_assert(uv->v == &uv->u.value); /* must be closed */ |
303 | checkvalref(g, o, uv->v); | 303 | checkvalref(g, o, uv->v); |
304 | break; | 304 | break; |
305 | } | 305 | } |
@@ -334,14 +334,11 @@ int lua_checkmemory (lua_State *L) { | |||
334 | global_State *g = G(L); | 334 | global_State *g = G(L); |
335 | GCObject *o; | 335 | GCObject *o; |
336 | checkstack(g, g->mainthread); | 336 | checkstack(g, g->mainthread); |
337 | for (o = g->rootgc; o->gch.tt != LUA_TUSERDATA; o = o->gch.next) | 337 | for (o = g->rootgc; o != obj2gco(g->mainthread); o = o->gch.next) |
338 | checkobject(g, o); | 338 | checkobject(g, o); |
339 | lua_assert(o == g->firstudata); | 339 | checkobject(g, obj2gco(g->mainthread)); |
340 | for (; o->gch.tt != LUA_TTHREAD; o = o->gch.next) | 340 | for (o = g->mainthread->next; o != NULL; o = o->gch.next) { |
341 | checkobject(g, o); | 341 | lua_assert(o->gch.tt == LUA_TUSERDATA); |
342 | lua_assert(o == obj2gco(g->mainthread)); | ||
343 | for (; o; o = o->gch.next) { | ||
344 | lua_assert(o->gch.tt == LUA_TTHREAD); | ||
345 | checkobject(g, o); | 342 | checkobject(g, o); |
346 | } | 343 | } |
347 | return 0; | 344 | return 0; |