|
@@ -727,14 +727,8 @@ static TraceNo trace_exit_find(jit_State *J, MCode *pc)
|
|
TraceNo traceno;
|
|
TraceNo traceno;
|
|
for (traceno = 1; traceno < J->sizetrace; traceno++) {
|
|
for (traceno = 1; traceno < J->sizetrace; traceno++) {
|
|
GCtrace *T = traceref(J, traceno);
|
|
GCtrace *T = traceref(J, traceno);
|
|
- if (T && pc >= T->mcode && pc < (MCode *)((char *)T->mcode + T->szmcode)) {
|
|
|
|
- if (J->exitno == T->nsnap) { /* Treat stack check like a parent exit. */
|
|
|
|
- lua_assert(T->root != 0);
|
|
|
|
- traceno = T->ir[REF_BASE].op1;
|
|
|
|
- J->exitno = T->ir[REF_BASE].op2;
|
|
|
|
- }
|
|
|
|
|
|
+ if (T && pc >= T->mcode && pc < (MCode *)((char *)T->mcode + T->szmcode))
|
|
return traceno;
|
|
return traceno;
|
|
- }
|
|
|
|
}
|
|
}
|
|
lua_assert(0);
|
|
lua_assert(0);
|
|
return 0;
|
|
return 0;
|
|
@@ -751,11 +745,20 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr)
|
|
int errcode;
|
|
int errcode;
|
|
const BCIns *pc;
|
|
const BCIns *pc;
|
|
void *cf;
|
|
void *cf;
|
|
|
|
+ GCtrace *T;
|
|
#ifdef EXITSTATE_PCREG
|
|
#ifdef EXITSTATE_PCREG
|
|
J->parent = trace_exit_find(J, (MCode *)(intptr_t)ex->gpr[EXITSTATE_PCREG]);
|
|
J->parent = trace_exit_find(J, (MCode *)(intptr_t)ex->gpr[EXITSTATE_PCREG]);
|
|
#endif
|
|
#endif
|
|
- lua_assert(traceref(J, J->parent) != NULL &&
|
|
|
|
- J->exitno < traceref(J, J->parent)->nsnap);
|
|
|
|
|
|
+ T = traceref(J, J->parent); UNUSED(T);
|
|
|
|
+#ifdef EXITSTATE_CHECKEXIT
|
|
|
|
+ if (J->exitno == T->nsnap) { /* Treat stack check like a parent exit. */
|
|
|
|
+ lua_assert(T->root != 0);
|
|
|
|
+ J->exitno = T->ir[REF_BASE].op2;
|
|
|
|
+ J->parent = T->ir[REF_BASE].op1;
|
|
|
|
+ T = traceref(J, J->parent);
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+ lua_assert(T != NULL && J->exitno < T->nsnap);
|
|
exd.J = J;
|
|
exd.J = J;
|
|
exd.exptr = exptr;
|
|
exd.exptr = exptr;
|
|
errcode = lj_vm_cpcall(L, NULL, &exd, trace_exit_cp);
|
|
errcode = lj_vm_cpcall(L, NULL, &exd, trace_exit_cp);
|