8000 Correct fix for stack check when recording BC_VARG. · LuaJIT/LuaJIT@b279117 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit b279117

Browse files
author
Mike Pall
committed
Correct fix for stack check when recording BC_VARG.
Reported by Yichun Zhang.
1 parent cc96ab9 commit b279117

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lj_record.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1522,6 +1522,8 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
15221522
} else if (dst + nresults > J->maxslot) {
15231523
J->maxslot = dst + (BCReg)nresults;
15241524
}
1525+
if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS)
1526+
lj_trace_err(J, LJ_TRERR_STACKOV);
15251527
for (i = 0; i < nresults; i++)
15261528
J->base[dst+i] = i < nvararg ? getslot(J, i - nvararg - 1) : TREF_NIL;
15271529
} else { /* Unknown number of varargs passed to trace. */
@@ -1602,8 +1604,6 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
16021604
lj_trace_err_info(J, LJ_TRERR_NYIBC);
16031605
}
16041606
}
1605-
if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS)
1606-
lj_trace_err(J, LJ_TRERR_STACKOV);
16071607
}
16081608

16091609
/* -- Record allocations -------------------------------------------------- */

0 commit comments

Comments
 (0)
0