]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix stack check when recording BC_VARG.
authorMike Pall <mike>
Sun, 8 Dec 2019 18:32:27 +0000 (19:32 +0100)
committerMike Pall <mike>
Sun, 8 Dec 2019 18:32:27 +0000 (19:32 +0100)
Contributed by Yichun Zhang.

src/lj_record.c

index bc4e8a6d25b169a1dad815b58f72a181abba086e..651bbf5523566e8766ef4cd7eb514b56151e7556 100644 (file)
@@ -1602,6 +1602,8 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
       lj_trace_err_info(J, LJ_TRERR_NYIBC);
     }
   }
+  if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS)
+    lj_trace_err(J, LJ_TRERR_STACKOV);
 }
 
 /* -- Record allocations -------------------------------------------------- */