Просмотр исходного кода

Detail in 'obj2gco'

Its check should use the type of the object, not its tag. (Change only
relevant in test mode.)
Roberto I 5 месяцев назад
Родитель
Сommit
c688b00f73
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      lstate.h

+ 2 - 2
lstate.h

@@ -430,9 +430,9 @@ union GCUnion {
 
 /*
 ** macro to convert a Lua object into a GCObject
-** (The access to 'tt' tries to ensure that 'v' is actually a Lua object.)
 */
-#define obj2gco(v)	check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc))
+#define obj2gco(v)  \
+	check_exp(novariant((v)->tt) >= LUA_TSTRING, &(cast_u(v)->gc))
 
 
 /* actual number of total memory allocated */