]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Add workaround for bytecode dump of builtins.
authorMike Pall <mike>
Sat, 12 Aug 2023 12:37:35 +0000 (14:37 +0200)
committerMike Pall <mike>
Sat, 12 Aug 2023 12:37:35 +0000 (14:37 +0200)
Reported by Hang Zhou. Thanks to Sergey Kaplun. #1038

src/lj_bcwrite.c

index 2c70ff470d230a25bfff6bd63996c0a914fd1f12..d3986ea4e83946a8fe0b1614f933d34b75d5c4cd 100644 (file)
@@ -189,7 +189,8 @@ static void bcwrite_knum(BCWriteCtx *ctx, GCproto *pt)
       goto save_int;
     } else {
       /* Write a 33 bit ULEB128 for the int (lsb=0) or loword (lsb=1). */
-      if (!LJ_DUALNUM) {  /* Narrow number constants to integers. */
+      if (!LJ_DUALNUM && o->u32.hi != LJ_KEYINDEX) {
+       /* Narrow number constants to integers. */
        lua_Number num = numV(o);
        k = lj_num2int(num);
        if (num == (lua_Number)k) {  /* -0 is never a constant. */