diff options
author | Mike Pall <mike> | 2010-04-25 23:21:15 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2010-04-25 23:21:15 +0200 |
commit | 41379126a2e41179068800f5ab791cc84f740228 (patch) | |
tree | d973dc7a6e89b3f67b0438e2bdae7c46fe24a26a /src/lj_api.c | |
parent | f396f3d192eb635b3b3a3d074e45e6b810689918 (diff) | |
download | luajit2-41379126a2e41179068800f5ab791cc84f740228.tar.gz |
Treat the tag of a TValue as unsigned everywhere.
Diffstat (limited to 'src/lj_api.c')
-rw-r--r-- | src/lj_api.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lj_api.c b/src/lj_api.c index 2b99c267..b9bac1d4 100644 --- a/src/lj_api.c +++ b/src/lj_api.c @@ -195,9 +195,10 @@ LUA_API int lua_type(lua_State *L, int idx) } else if (o == niltv(L)) { return LUA_TNONE; } else { /* Magic internal/external tag conversion. ORDER LJ_T */ - int t = ~itype(o); - lua_assert(itype(o) != LJ_TUPVAL); - return (int)(((t < 8 ? 0x98042110 : 0x7506) >> 4*(t&7)) & 15u); + uint32_t t = ~itype(o); + int tt = (int)(((t < 8 ? 0x98042110 : 0x7506) >> 4*(t&7)) & 15u); + lua_assert(tt != LUA_TNIL || tvisnil(o)); + return tt; } } |