From eac2fdacfb1b3b86e09f25c025ee7a2b2e24671b Mon Sep 17 00:00:00 2001 From: Savannah Ostrowski Date: Fri, 6 Sep 2024 09:02:32 -0700 Subject: [PATCH] [3.13] GH-123545: Remove duplicate Py_DECREF when handling _PyOptimizer_Optimize errors (GH-123759) (cherry picked from commit 1fbc118c5d3916e920a57cda3cb6d9a0292de26e) Co-authored-by: Savannah Ostrowski --- .../2024-09-01-00-02-05.gh-issue-123545.8nQNbL.rst | 1 + Python/bytecodes.c | 2 -- Python/executor_cases.c.h | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2024-09-01-00-02-05.gh-issue-123545.8nQNbL.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2024-09-01-00-02-05.gh-issue-123545.8nQNbL.rst b/Misc/NEWS.d/next/Core_and_Builtins/2024-09-01-00-02-05.gh-issue-123545.8nQNbL.rst new file mode 100644 index 000000000000..4da4151416d1 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2024-09-01-00-02-05.gh-issue-123545.8nQNbL.rst @@ -0,0 +1 @@ +Fix a double decref in rare cases on experimental JIT builds. diff --git a/Python/bytecodes.c b/Python/bytecodes.c index d9533110af20..1e6185d3c9e4 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -4322,8 +4322,6 @@ dummy_func( if (optimized <= 0) { exit->temperature = restart_backoff_counter(exit->temperature); if (optimized < 0) { - Py_DECREF(current_executor); - tstate->previous_executor = Py_None; GOTO_UNWIND(); } GOTO_TIER_ONE(target); diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 799f3b7f6923..df7c19a80e40 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -4390,8 +4390,6 @@ if (optimized <= 0) { exit->temperature = restart_backoff_counter(exit->temperature); if (optimized < 0) { - Py_DECREF(current_executor); - tstate->previous_executor = Py_None; GOTO_UNWIND(); } GOTO_TIER_ONE(target); -- 2.47.3