]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Make recording of type() independent of LJ_T*/IRT_* mapping.
authorMike Pall <mike>
Tue, 28 Dec 2010 17:23:41 +0000 (18:23 +0100)
committerMike Pall <mike>
Tue, 28 Dec 2010 17:23:41 +0000 (18:23 +0100)
src/lj_ffrecord.c

index e2f8a39feb16d76039813c0cb18f4129d081317c..b7ee06cd66d3c1e987ef286e0acea69c7205b3f7 100644 (file)
@@ -127,7 +127,13 @@ static void LJ_FASTCALL recff_assert(jit_State *J, RecordFFData *rd)
 static void LJ_FASTCALL recff_type(jit_State *J, RecordFFData *rd)
 {
   /* Arguments already specialized. Result is a constant string. Neat, huh? */
-  IRType t = tref_isinteger(J->base[0]) ? IRT_NUM : tref_type(J->base[0]);
+  uint32_t t;
+  if (tvisnum(&rd->argv[0]))
+    t = ~LJ_TNUMX;
+  else if (LJ_64 && tvislightud(&rd->argv[0]))
+    t = ~LJ_TLIGHTUD;
+  else
+    t = ~itype(&rd->argv[0]);
   J->base[0] = lj_ir_kstr(J, strV(&J->fn->c.upvalue[t]));
   UNUSED(rd);
 }