From 00ad80c9e4258d10b2a26e9af8fa5e86c9e75e2e Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Thu, 18 Feb 2010 02:45:03 +0100 Subject: [PATCH] Clear frame gaps in recorder to avoid resurrecting previous refs. --- src/lj_record.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lj_record.c b/src/lj_record.c index 5d99f3a4..bc19d74c 100644 --- a/src/lj_record.c +++ b/src/lj_record.c @@ -600,7 +600,7 @@ static BCReg rec_mm_prep(jit_State *J, ASMFunction cont) #endif J->base[top] = trcont | TREF_CONT; for (s = J->maxslot; s < top; s++) - J->base[s] = TREF_NIL; + J->base[s] = 0; /* Clear frame gap to avoid resurrecting previous refs. */ return top+1; } @@ -1982,7 +1982,11 @@ void lj_record_ins(jit_State *J) /* -- Constant and move ops --------------------------------------------- */ - case BC_KSTR: case BC_KNUM: case BC_KPRI: case BC_MOV: + case BC_MOV: + /* Clear gap of method call to avoid resurrecting previous refs. */ + if (ra > J->maxslot) J->base[ra-1] = 0; + break; + case BC_KSTR: case BC_KNUM: case BC_KPRI: break; case BC_KSHORT: rc = lj_ir_kint(J, (int32_t)(int16_t)rc);