diff options
-rw-r--r-- | ltests.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.77 2009/10/23 19:12:19 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.78 2009/11/05 17:43:54 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 | */ |
@@ -202,9 +202,12 @@ static int testobjref (global_State *g, GCObject *f, GCObject *t) { | |||
202 | 202 | ||
203 | #define checkobjref(g,f,t) lua_assert(testobjref(g,f,obj2gco(t))) | 203 | #define checkobjref(g,f,t) lua_assert(testobjref(g,f,obj2gco(t))) |
204 | 204 | ||
205 | #define checkvalref(g,f,t) lua_assert(!iscollectable(t) || \ | ||
206 | ((ttype(t) == gch(gcvalue(t))->tt) && testobjref(g,f,gcvalue(t)))) | ||
207 | 205 | ||
206 | static void checkvalref (global_State *g, GCObject *f, const TValue *t) { | ||
207 | if (iscollectable(t)) { | ||
208 | lua_assert(righttt(t) && testobjref(g, f, gcvalue(t))); | ||
209 | } | ||
210 | } | ||
208 | 211 | ||
209 | 212 | ||
210 | static void checktable (global_State *g, Table *h) { | 213 | static void checktable (global_State *g, Table *h) { |