From: Mike Pall Date: Sun, 9 Mar 2025 22:09:02 +0000 (+0100) Subject: Merge branch 'master' into v2.1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0551670c99d842d30116ba3056fae000b6e315e;p=thirdparty%2FLuaJIT.git Merge branch 'master' into v2.1 --- e0551670c99d842d30116ba3056fae000b6e315e diff --cc src/lj_trace.c index 144461b3,c7ac0bfa..0e948e8d --- a/src/lj_trace.c +++ b/src/lj_trace.c @@@ -218,20 -202,11 +218,12 @@@ static void trace_unpatch(jit_State *J break; case BC_JITERL: case BC_JLOOP: - lua_assert(op == BC_ITERL || op == BC_LOOP || bc_isret(op)); + lj_assertJ(op == BC_ITERL || op == BC_ITERN || op == BC_LOOP || + bc_isret(op), "bad original bytecode %d", op); *pc = T->startins; break; - case BC_JMP: - lj_assertJ(op == BC_ITERL, "bad original bytecode %d", op); - pc += bc_j(*pc)+2; - if (bc_op(*pc) == BC_JITERL) { - lj_assertJ(traceref(J, bc_d(*pc)) == T, "JITERL references other trace"); - *pc = T->startins; - } - break; case BC_JFUNCF: - lua_assert(op == BC_FUNCF); + lj_assertJ(op == BC_FUNCF, "bad original bytecode %d", op); *pc = T->startins; break; default: /* Already unpatched. */ @@@ -243,10 -218,7 +235,8 @@@ static void trace_flushroot(jit_State *J, GCtrace *T) { GCproto *pt = &gcref(T->startpt)->pt; - lua_assert(T->root == 0 && pt != NULL); + lj_assertJ(T->root == 0, "not a root trace"); + lj_assertJ(pt != NULL, "trace has no prototype"); - /* First unpatch any modified bytecode. */ - trace_unpatch(J, T); /* Unlink root trace from chain anchored in prototype. */ if (pt->trace == T->traceno) { /* Trace is first in chain. Easy. */ pt->trace = T->nextroot;