From a1c887e3b960f99e293817ac0cbfda57a4ae42c5 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Sat, 19 Mar 2011 17:30:15 +0100 Subject: [PATCH] Fix data-flow analysis for BC_ITERC. --- src/lj_snap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lj_snap.c b/src/lj_snap.c index 70628a0e..c044923a 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c @@ -217,7 +217,8 @@ static BCReg snap_usedef(jit_State *J, uint8_t *udf, if (op >= BC_CALLM && op <= BC_VARG) { BCReg top = (op == BC_CALLM || op == BC_CALLMT || bc_c(ins) == 0) ? maxslot : (bc_a(ins) + bc_c(ins)); - for (s = bc_a(ins); s < top; s++) USE_SLOT(s); + s = bc_a(ins) - ((op == BC_ITERC || op == BC_ITERN) ? 3 : 0); + for (; s < top; s++) USE_SLOT(s); for (; s < maxslot; s++) DEF_SLOT(s); if (op == BC_CALLT || op == BC_CALLMT) { for (s = 0; s < bc_a(ins); s++) DEF_SLOT(s);