]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
merge from upstream
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Mon, 27 Oct 2025 18:30:18 +0000 (18:30 +0000)
committerKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Mon, 27 Oct 2025 18:30:18 +0000 (18:30 +0000)
Python/bytecodes.c
Python/executor_cases.c.h
Python/optimizer.c

index 0fad05e9c18381abf963e12c0822145618b36416..971660ace56ab0e1b164dd49bee5a25550418e57 100644 (file)
@@ -5392,10 +5392,7 @@ dummy_func(
 
         tier2 op(_ERROR_POP_N, (target/2 --)) {
             assert(oparg == 0);
-            _Py_CODEUNIT *current_instr = _PyFrame_GetBytecode(frame) + target;
-            _Py_CODEUNIT *next_instr = current_instr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[current_instr->op.code]];
-            // gh-140104: The exception handler expects frame->instr_ptr to be pointing to next_instr, not this_instr!
-            frame->instr_ptr = next_instr;
+            frame->instr_ptr = _PyFrame_GetBytecode(frame) + target;
             SYNC_SP();
             GOTO_TIER_ONE(NULL);
         }
index 9e46786d050eada4d366f1132b00763c1e6c72e6..5273670008c029c3cd9f9b1e9c1cdf17dfb13205 100644 (file)
             oparg = CURRENT_OPARG();
             uint32_t target = (uint32_t)CURRENT_OPERAND0();
             assert(oparg == 0);
-            _Py_CODEUNIT *current_instr = _PyFrame_GetBytecode(frame) + target;
-            _Py_CODEUNIT *next_instr = current_instr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[current_instr->op.code]];
-            frame->instr_ptr = next_instr;
+            frame->instr_ptr = _PyFrame_GetBytecode(frame) + target;
             GOTO_TIER_ONE(NULL);
             break;
         }
index c7f7f0209318cce69e62890f1ca77621a440065b..4b41236b69ba2ad9ab705e3a29e3f506b970531b 100644 (file)
@@ -1352,7 +1352,6 @@ uop_optimize(
     assert(length <= UOP_MAX_TRACE_LENGTH);
 
     // Check executor coldness
-    PyThreadState *tstate = PyThreadState_Get();
     // It's okay if this ends up going negative.
     if (--tstate->interp->executor_creation_counter == 0) {
         _Py_set_eval_breaker_bit(tstate, _PY_EVAL_JIT_INVALIDATE_COLD_BIT);