aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-08-26 09:41:10 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-08-26 09:41:10 -0300
commit742b7377d38e43224ee5dda4bb83a42763c20af8 (patch)
tree7caeaa7077ff6414f20646b7cef5308ad5bc2199 /ltests.c
parent50955e27f592441a223c6267956e470f98eeb3c0 (diff)
downloadlua-742b7377d38e43224ee5dda4bb83a42763c20af8.tar.gz
lua-742b7377d38e43224ee5dda4bb83a42763c20af8.tar.bz2
lua-742b7377d38e43224ee5dda4bb83a42763c20af8.zip
Lua closures go to local, too
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/ltests.c b/ltests.c
index d35bab5c..199a492f 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.147 2013/08/21 19:21:16 roberto Exp roberto $ 2** $Id: ltests.c,v 2.148 2013/08/22 15:21:48 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*/
@@ -400,7 +400,8 @@ static void checkobject (global_State *g, GCObject *o, int maybedead) {
400 400
401#define TESTGRAYBIT 7 401#define TESTGRAYBIT 7
402 402
403static void checkgraylist (GCObject *l) { 403static void checkgraylist (global_State *g, GCObject *l) {
404 UNUSED(g); /* better to keep it available if we need to print an object */
404 while (l) { 405 while (l) {
405 lua_assert(isgray(l)); 406 lua_assert(isgray(l));
406 lua_assert(!testbit(l->gch.marked, TESTGRAYBIT)); 407 lua_assert(!testbit(l->gch.marked, TESTGRAYBIT));
@@ -423,11 +424,11 @@ static void checkgraylist (GCObject *l) {
423*/ 424*/
424static void markgrays (global_State *g) { 425static void markgrays (global_State *g) {
425 if (!keepinvariant(g)) return; 426 if (!keepinvariant(g)) return;
426 checkgraylist(g->gray); 427 checkgraylist(g, g->gray);
427 checkgraylist(g->grayagain); 428 checkgraylist(g, g->grayagain);
428 checkgraylist(g->weak); 429 checkgraylist(g, g->weak);
429 checkgraylist(g->ephemeron); 430 checkgraylist(g, g->ephemeron);
430 checkgraylist(g->allweak); 431 checkgraylist(g, g->allweak);
431} 432}
432 433
433 434
@@ -484,6 +485,17 @@ int lua_checkmemory (lua_State *L) {
484 lua_assert(gch(o)->tt == LUA_TUSERDATA || 485 lua_assert(gch(o)->tt == LUA_TUSERDATA ||
485 gch(o)->tt == LUA_TTABLE); 486 gch(o)->tt == LUA_TTABLE);
486 } 487 }
488 /* check 'localgc' list */
489 checkgray(g, g->localgc);
490 for (o = g->localgc; o != NULL; o = gch(o)->next) {
491 checkobject(g, o, 1);
492 }
493 /* check 'localupv' list */
494 checkgray(g, g->localupv);
495 for (o = g->localupv; o != NULL; o = gch(o)->next) {
496 lua_assert(gch(o)->tt == LUA_TUPVAL);
497 checkobject(g, o, 1);
498 }
487 return 0; 499 return 0;
488} 500}
489 501