Browse Source

Fix maxslots when recording BC_VARG.

Analyzed by Sergey Kaplun. #1024
Mike Pall 2 years ago
parent
commit
94ada59628
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/lj_record.c

+ 1 - 2
src/lj_record.c

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