From 22952d89738dab09afc4d23e79677d973356db48 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 1 Sep 2014 14:58:55 -0300 Subject: 'T.gccolor' classify dead objects too --- ltests.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 48fd8e23..2a45dc7e 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 2.182 2014/07/23 16:44:30 roberto Exp roberto $ +** $Id: ltests.c,v 2.183 2014/08/01 17:33:08 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -598,9 +598,12 @@ static int gc_color (lua_State *L) { o = obj_at(L, 1); if (!iscollectable(o)) lua_pushstring(L, "no collectable"); - else - lua_pushstring(L, iswhite(gcvalue(o)) ? "white" : - isblack(gcvalue(o)) ? "black" : "grey"); + else { + GCObject *obj = gcvalue(o); + lua_pushstring(L, isdead(G(L), obj) ? "dead" : + iswhite(obj) ? "white" : + isblack(obj) ? "black" : "grey"); + } return 1; } -- cgit v1.2.3-55-g6feb