mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
Fix maxslots when recording BC_VARG, part 2.
Analyzed by Sergey Kaplun. #1024
This commit is contained in:
parent
94ada59628
commit
a01cba9d2d
@ -1518,12 +1518,8 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
|
|||||||
if (J->framedepth > 0) { /* Simple case: varargs defined on-trace. */
|
if (J->framedepth > 0) { /* Simple case: varargs defined on-trace. */
|
||||||
ptrdiff_t i;
|
ptrdiff_t i;
|
||||||
if (nvararg < 0) nvararg = 0;
|
if (nvararg < 0) nvararg = 0;
|
||||||
if (nresults == -1) {
|
if (nresults == -1) nresults = nvararg;
|
||||||
nresults = nvararg;
|
J->maxslot = dst + (BCReg)nresults;
|
||||||
J->maxslot = dst + (BCReg)nvararg;
|
|
||||||
} else if (dst + nresults > J->maxslot) {
|
|
||||||
J->maxslot = dst + (BCReg)nresults;
|
|
||||||
}
|
|
||||||
if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS)
|
if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS)
|
||||||
lj_trace_err(J, LJ_TRERR_STACKOV);
|
lj_trace_err(J, LJ_TRERR_STACKOV);
|
||||||
for (i = 0; i < nresults; i++)
|
for (i = 0; i < nresults; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user