Skip to content

Commit

Permalink
Fix use-def analysis for BC_VARG.
Browse files Browse the repository at this point in the history
Reported by Ryan Lucia.
  • Loading branch information
Mike Pall committed May 24, 2021
1 parent 44684fa commit 2801500
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lj_snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static BCReg snap_usedef(jit_State *J, uint8_t *udf,
if (!(op == BC_ISTC || op == BC_ISFC)) DEF_SLOT(bc_a(ins));
break;
case BCMbase:
if (op >= BC_CALLM && op <= BC_VARG) {
if (op >= BC_CALLM && op <= BC_ITERN) {
BCReg top = (op == BC_CALLM || op == BC_CALLMT || bc_c(ins) == 0) ?
maxslot : (bc_a(ins) + bc_c(ins));
s = bc_a(ins) - ((op == BC_ITERC || op == BC_ITERN) ? 3 : 0);
Expand All @@ -248,6 +248,8 @@ static BCReg snap_usedef(jit_State *J, uint8_t *udf,
for (s = 0; s < bc_a(ins); s++) DEF_SLOT(s);
return 0;
}
} else if (op == BC_VARG) {
return maxslot; /* NYI: punt. */
} else if (op == BC_KNIL) {
for (s = bc_a(ins); s <= bc_d(ins); s++) DEF_SLOT(s);
} else if (op == BC_TSETM) {
Expand Down

0 comments on commit 2801500

Please sign in to comment.