]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix LJ_MAX_JSLOTS assertion in rec_check_slots().
authorMike Pall <mike>
Tue, 9 May 2017 18:59:37 +0000 (20:59 +0200)
committerMike Pall <mike>
Tue, 9 May 2017 18:59:37 +0000 (20:59 +0200)
Thanks to Yichun Zhang.

src/lj_record.c

index 7b5727648947dddb8927c42852a88895d562739c..cecacd218b4c3f30799423605e0cf81541b31bdb 100644 (file)
@@ -81,9 +81,9 @@ static void rec_check_slots(jit_State *J)
   BCReg s, nslots = J->baseslot + J->maxslot;
   int32_t depth = 0;
   cTValue *base = J->L->base - J->baseslot;
-  lua_assert(J->baseslot >= 1 && J->baseslot < LJ_MAX_JSLOTS);
+  lua_assert(J->baseslot >= 1);
   lua_assert(J->baseslot == 1 || (J->slot[J->baseslot-1] & TREF_FRAME));
-  lua_assert(nslots < LJ_MAX_JSLOTS);
+  lua_assert(nslots <= LJ_MAX_JSLOTS);
   for (s = 0; s < nslots; s++) {
     TRef tr = J->slot[s];
     if (tr) {