aboutsummaryrefslogtreecommitdiff
path: root/src/lj_asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r--src/lj_asm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index f38ceaef..34357e95 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -3212,8 +3212,14 @@ static void asm_tail_link(ASMState *as)
3212 3212
3213 if (as->T->link == TRACE_INTERP) { 3213 if (as->T->link == TRACE_INTERP) {
3214 /* Setup fixed registers for exit to interpreter. */ 3214 /* Setup fixed registers for exit to interpreter. */
3215 const BCIns *pc = snap_pc(as->T->snapmap[snap->mapofs + snap->nent]);
3216 if (bc_op(*pc) == BC_JLOOP) { /* NYI: find a better way to do this. */
3217 BCIns *retpc = &as->J->trace[bc_d(*pc)]->startins;
3218 if (bc_isret(bc_op(*retpc)))
3219 pc = retpc;
3220 }
3215 emit_loada(as, RID_DISPATCH, J2GG(as->J)->dispatch); 3221 emit_loada(as, RID_DISPATCH, J2GG(as->J)->dispatch);
3216 emit_loada(as, RID_PC, snap_pc(as->T->snapmap[snap->mapofs + snap->nent])); 3222 emit_loada(as, RID_PC, pc);
3217 } else if (baseslot) { 3223 } else if (baseslot) {
3218 /* Save modified BASE for linking to trace with higher start frame. */ 3224 /* Save modified BASE for linking to trace with higher start frame. */
3219 emit_setgl(as, RID_BASE, jit_base); 3225 emit_setgl(as, RID_BASE, jit_base);