summaryrefslogtreecommitdiff
path: root/src/lj_record.c
diff options
context:
space:
mode:
authorMike Pall <mike>2010-02-18 02:45:03 +0100
committerMike Pall <mike>2010-02-18 02:45:03 +0100
commit00ad80c9e4258d10b2a26e9af8fa5e86c9e75e2e (patch)
treeeab7418d201d6d7c6da7addcb3de09f58fae20a3 /src/lj_record.c
parent4a7ee2cb66daf4d146d645e167a3645ae2692d5d (diff)
downloadluajit-00ad80c9e4258d10b2a26e9af8fa5e86c9e75e2e.tar.gz
luajit-00ad80c9e4258d10b2a26e9af8fa5e86c9e75e2e.tar.bz2
luajit-00ad80c9e4258d10b2a26e9af8fa5e86c9e75e2e.zip
Clear frame gaps in recorder to avoid resurrecting previous refs.
Diffstat (limited to 'src/lj_record.c')
-rw-r--r--src/lj_record.c8
1 files 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)
600#endif 600#endif
601 J->base[top] = trcont | TREF_CONT; 601 J->base[top] = trcont | TREF_CONT;
602 for (s = J->maxslot; s < top; s++) 602 for (s = J->maxslot; s < top; s++)
603 J->base[s] = TREF_NIL; 603 J->base[s] = 0; /* Clear frame gap to avoid resurrecting previous refs. */
604 return top+1; 604 return top+1;
605} 605}
606 606
@@ -1982,7 +1982,11 @@ void lj_record_ins(jit_State *J)
1982 1982
1983 /* -- Constant and move ops --------------------------------------------- */ 1983 /* -- Constant and move ops --------------------------------------------- */
1984 1984
1985 case BC_KSTR: case BC_KNUM: case BC_KPRI: case BC_MOV: 1985 case BC_MOV:
1986 /* Clear gap of method call to avoid resurrecting previous refs. */
1987 if (ra > J->maxslot) J->base[ra-1] = 0;
1988 break;
1989 case BC_KSTR: case BC_KNUM: case BC_KPRI:
1986 break; 1990 break;
1987 case BC_KSHORT: 1991 case BC_KSHORT:
1988 rc = lj_ir_kint(J, (int32_t)(int16_t)rc); 1992 rc = lj_ir_kint(J, (int32_t)(int16_t)rc);