mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix use-def analysis for vararg functions.
Reported by Shmuel Zeigerman.
This commit is contained in:
parent
2801500a26
commit
0e53a314d7
@ -271,8 +271,10 @@ static BCReg snap_usedef(jit_State *J, uint8_t *udf,
|
|||||||
void lj_snap_purge(jit_State *J)
|
void lj_snap_purge(jit_State *J)
|
||||||
{
|
{
|
||||||
uint8_t udf[SNAP_USEDEF_SLOTS];
|
uint8_t udf[SNAP_USEDEF_SLOTS];
|
||||||
BCReg maxslot = J->maxslot;
|
BCReg s, maxslot = J->maxslot;
|
||||||
BCReg s = snap_usedef(J, udf, J->pc, maxslot);
|
if (bc_op(*J->pc) == BC_FUNCV && maxslot > J->pt->numparams)
|
||||||
|
maxslot = J->pt->numparams;
|
||||||
|
s = snap_usedef(J, udf, J->pc, maxslot);
|
||||||
for (; s < maxslot; s++)
|
for (; s < maxslot; s++)
|
||||||
if (udf[s] != 0)
|
if (udf[s] != 0)
|
||||||
J->base[s] = 0; /* Purge dead slots. */
|
J->base[s] = 0; /* Purge dead slots. */
|
||||||
|
Loading…
Reference in New Issue
Block a user