From: Savannah Ostrowski Date: Fri, 6 Sep 2024 16:02:32 +0000 (-0700) Subject: [3.13] GH-123545: Remove duplicate Py_DECREF when handling _PyOptimizer_Optimize... X-Git-Tag: v3.13.0rc2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eac2fdacfb1b3b86e09f25c025ee7a2b2e24671b;p=thirdparty%2FPython%2Fcpython.git [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 --- 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);