]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix maxslots when recording BC_VARG.
authorMike Pall <mike>
Sat, 8 Jul 2023 17:40:12 +0000 (19:40 +0200)
committerMike Pall <mike>
Sat, 8 Jul 2023 17:40:12 +0000 (19:40 +0200)
Analyzed by Sergey Kaplun. #1024

src/lj_record.c

index 10a14a6f87c505822098624f5200deae88a9366a..c9933968f908bed3a7aedac1924084ecb40d9359 100644 (file)
@@ -1556,8 +1556,7 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
       }
       for (i = nvararg; i < nresults; i++)
        J->base[dst+i] = TREF_NIL;
-      if (dst + (BCReg)nresults > J->maxslot)
-       J->maxslot = dst + (BCReg)nresults;
+      J->maxslot = dst + (BCReg)nresults;
     } else if (select_detect(J)) {  /* y = select(x, ...) */
       TRef tridx = J->base[dst-1];
       TRef tr = TREF_NIL;