From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Mon, 27 Oct 2025 18:27:32 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/main' into tracing_jit X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5a9b0703c59431712e0e8f9540e976310b3eef3;p=thirdparty%2FPython%2Fcpython.git Merge remote-tracking branch 'upstream/main' into tracing_jit --- b5a9b0703c59431712e0e8f9540e976310b3eef3 diff --cc Python/ceval_macros.h index 634b949fa59c,8083913b1a1c..d4f4a83e1340 --- a/Python/ceval_macros.h +++ b/Python/ceval_macros.h @@@ -399,18 -357,12 +399,20 @@@ do next_instr = _Py_jit_entry((EXECUTOR), frame, stack_pointer, tstate); \ frame = tstate->current_frame; \ stack_pointer = _PyFrame_GetStackPointer(frame); \ + int keep_tracing_bit = (uintptr_t)next_instr & 1; \ + next_instr = (_Py_CODEUNIT *)(((uintptr_t)next_instr) & (~1)); \ if (next_instr == NULL) { \ - next_instr = frame->instr_ptr; \ + /* gh-140104: The exception handler expects frame->instr_ptr + to after this_instr, not this_instr! */ \ + next_instr = frame->instr_ptr + 1; \ JUMP_TO_LABEL(error); \ } \ + if (keep_tracing_bit) { \ + assert(next_instr->op.code != ENTER_EXECUTOR); \ + assert(tstate->interp->jit_state.code_curr_size == 2); \ + ENTER_TRACING(); \ + DISPATCH_NON_TRACING(); \ + } \ DISPATCH(); \ } while (0)