diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-09-11 09:26:14 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-09-11 09:26:14 -0300 |
| commit | 79ab21be90792c00da98e5ec3d55c8a082c6e6de (patch) | |
| tree | 670daa1529887f95f5f3c3b3c855cd2d5cbdf39c | |
| parent | d3bbb34c24cfe3e5296c6a5d3faacf6c8679fe70 (diff) | |
| download | lua-79ab21be90792c00da98e5ec3d55c8a082c6e6de.tar.gz lua-79ab21be90792c00da98e5ec3d55c8a082c6e6de.tar.bz2 lua-79ab21be90792c00da98e5ec3d55c8a082c6e6de.zip | |
more invariants added to memory check
Diffstat (limited to '')
| -rw-r--r-- | ltests.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 2.154 2013/09/04 15:34:24 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.155 2013/09/05 19:31:49 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 | */ |
| @@ -449,6 +449,7 @@ int lua_checkmemory (lua_State *L) { | |||
| 449 | else lua_assert(!isthread); /* ... and only threads */ | 449 | else lua_assert(!isthread); /* ... and only threads */ |
| 450 | checkobject(g, o, maybedead); | 450 | checkobject(g, o, maybedead); |
| 451 | lua_assert(!tofinalize(o) && testbit(o->gch.marked, LOCALMARK)); | 451 | lua_assert(!tofinalize(o) && testbit(o->gch.marked, LOCALMARK)); |
| 452 | lua_assert(testbit(o->gch.marked, NOLOCALBIT)); | ||
| 452 | } | 453 | } |
| 453 | /* check 'localfin' list */ | 454 | /* check 'localfin' list */ |
| 454 | checkgray(g, g->localfin); | 455 | checkgray(g, g->localfin); |
| @@ -462,8 +463,8 @@ int lua_checkmemory (lua_State *L) { | |||
| 462 | for (o = g->finobj; o != NULL; o = gch(o)->next) { | 463 | for (o = g->finobj; o != NULL; o = gch(o)->next) { |
| 463 | checkobject(g, o, 0); | 464 | checkobject(g, o, 0); |
| 464 | lua_assert(tofinalize(o) && testbit(o->gch.marked, LOCALMARK)); | 465 | lua_assert(tofinalize(o) && testbit(o->gch.marked, LOCALMARK)); |
| 465 | lua_assert(gch(o)->tt == LUA_TUSERDATA || | 466 | lua_assert(testbit(o->gch.marked, NOLOCALBIT)); |
| 466 | gch(o)->tt == LUA_TTABLE); | 467 | lua_assert(gch(o)->tt == LUA_TUSERDATA || gch(o)->tt == LUA_TTABLE); |
| 467 | } | 468 | } |
| 468 | /* check 'tobefnz' list */ | 469 | /* check 'tobefnz' list */ |
| 469 | checkgray(g, g->tobefnz); | 470 | checkgray(g, g->tobefnz); |
