new type `boolean'

This commit is contained in:
Roberto Ierusalimschy
2001-12-11 20:48:44 -02:00
parent ed9be5e1f0
commit 9aff171f3b
18 changed files with 166 additions and 121 deletions

6
lgc.c
View File

@@ -110,7 +110,9 @@ static void markobject (GCState *st, TObject *o) {
break;
}
default: {
lua_assert(ttype(o) == LUA_TNIL || ttype(o) == LUA_TNUMBER);
lua_assert(ttype(o) == LUA_TNIL ||
ttype(o) == LUA_TNUMBER ||
ttype(o) == LUA_TBOOLEAN);
break;
}
}
@@ -196,7 +198,7 @@ static int hasmark (const TObject *o) {
return ismarked(hvalue(o));
case LUA_TFUNCTION:
return clvalue(o)->c.marked;
default: /* number, nil */
default: /* number, nil, boolean */
return 1;
}
}