diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-09-01 14:58:55 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-09-01 14:58:55 -0300 |
commit | 22952d89738dab09afc4d23e79677d973356db48 (patch) | |
tree | 09ab3ea88100bee722e879b55b6b8cb79a09f00f /ltests.c | |
parent | df608f842ab20a878cf8ed337a4066f5567786a5 (diff) | |
download | lua-22952d89738dab09afc4d23e79677d973356db48.tar.gz lua-22952d89738dab09afc4d23e79677d973356db48.tar.bz2 lua-22952d89738dab09afc4d23e79677d973356db48.zip |
'T.gccolor' classify dead objects too
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.182 2014/07/23 16:44:30 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.183 2014/08/01 17:33:08 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 | */ |
@@ -598,9 +598,12 @@ static int gc_color (lua_State *L) { | |||
598 | o = obj_at(L, 1); | 598 | o = obj_at(L, 1); |
599 | if (!iscollectable(o)) | 599 | if (!iscollectable(o)) |
600 | lua_pushstring(L, "no collectable"); | 600 | lua_pushstring(L, "no collectable"); |
601 | else | 601 | else { |
602 | lua_pushstring(L, iswhite(gcvalue(o)) ? "white" : | 602 | GCObject *obj = gcvalue(o); |
603 | isblack(gcvalue(o)) ? "black" : "grey"); | 603 | lua_pushstring(L, isdead(G(L), obj) ? "dead" : |
604 | iswhite(obj) ? "white" : | ||
605 | isblack(obj) ? "black" : "grey"); | ||
606 | } | ||
604 | return 1; | 607 | return 1; |
605 | } | 608 | } |
606 | 609 | ||