]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Merge branch 'master' into v2.1
authorMike Pall <mike>
Sun, 9 Mar 2025 22:09:02 +0000 (23:09 +0100)
committerMike Pall <mike>
Sun, 9 Mar 2025 22:09:02 +0000 (23:09 +0100)
1  2 
src/lj_trace.c

diff --cc src/lj_trace.c
index 144461b36f362982f5dc59c926415624b60dae56,c7ac0bfa512c5a6430285a386c4242af9221fafb..0e948e8d0816ef2efba7fa15badf76c533f94b46
@@@ -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. */
  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;