aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-11-06 15:08:43 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-11-06 15:08:43 -0200
commit63a3b1a1eb2fe8aca8315e28ac2c6d150b1ee218 (patch)
tree0bb4b2eab00cc08c442dd29e4b35c111d0168a2b /ltests.c
parentfbf866a1a575d37150b8ec5494bc497a9e213d8f (diff)
downloadlua-63a3b1a1eb2fe8aca8315e28ac2c6d150b1ee218.tar.gz
lua-63a3b1a1eb2fe8aca8315e28ac2c6d150b1ee218.tar.bz2
lua-63a3b1a1eb2fe8aca8315e28ac2c6d150b1ee218.zip
macro 'checkvalref' redefined as function (to avoid too long macros)
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ltests.c b/ltests.c
index d98f38f4..a04f7d6e 100644
--- a/ltests.c
+++ b/ltests.c
@@ -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
206static 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
210static void checktable (global_State *g, Table *h) { 213static void checktable (global_State *g, Table *h) {