瀏覽代碼

macro 'checkvalref' redefined as function (to avoid too long macros)

Roberto Ierusalimschy 15 年之前
父節點
當前提交
63a3b1a1eb
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      ltests.c

+ 6 - 3
ltests.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: ltests.c,v 2.77 2009/10/23 19:12:19 roberto Exp roberto $
+** $Id: ltests.c,v 2.78 2009/11/05 17:43:54 roberto Exp roberto $
 ** Internal Module for Debugging of the Lua Implementation
 ** Internal Module for Debugging of the Lua Implementation
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -202,9 +202,12 @@ static int testobjref (global_State *g, GCObject *f, GCObject *t) {
 
 
 #define checkobjref(g,f,t) lua_assert(testobjref(g,f,obj2gco(t)))
 #define checkobjref(g,f,t) lua_assert(testobjref(g,f,obj2gco(t)))
 
 
-#define checkvalref(g,f,t) lua_assert(!iscollectable(t) || \
-	((ttype(t) == gch(gcvalue(t))->tt) && testobjref(g,f,gcvalue(t))))
 
 
+static void checkvalref (global_State *g, GCObject *f, const TValue *t) {
+  if (iscollectable(t)) {
+    lua_assert(righttt(t) && testobjref(g, f, gcvalue(t)));
+  }
+}
 
 
 
 
 static void checktable (global_State *g, Table *h) {
 static void checktable (global_State *g, Table *h) {