Treat the tag of a TValue as unsigned everywhere.

This commit is contained in:
Mike Pall
2010-04-25 23:21:15 +02:00
parent f396f3d192
commit 41379126a2
7 changed files with 39 additions and 40 deletions

View File

@@ -184,7 +184,7 @@ static BCReg const_num(FuncState *fs, ExpDesc *e)
}
/* Add a GC object constant. */
static BCReg const_gc(FuncState *fs, GCobj *gc, int itype)
static BCReg const_gc(FuncState *fs, GCobj *gc, uint32_t itype)
{
lua_State *L = fs->L;
TValue o, *val;
@@ -1294,10 +1294,10 @@ static void expr_bracket(LexState *ls, ExpDesc *v)
static void expr_kvalue(TValue *v, ExpDesc *e)
{
if (e->k <= VKTRUE) {
v->it = ~(int32_t)e->k;
setitype(v, ~(uint32_t)e->k);
} else if (e->k == VKSTR) {
setgcref(v->gcr, obj2gco(e->u.sval));
v->it = LJ_TSTR;
setitype(v, LJ_TSTR);
} else {
lua_assert(e->k == VKNUM);
setnumV(v, expr_numV(e));