https://github.com/python/cpython/commit/eac2fdacfb1b3b86e09f25c025ee7a2b2e24671b
commit: eac2fdacfb1b3b86e09f25c025ee7a2b2e24671b
branch: 3.13
author: Savannah Ostrowski <savannahostrow...@gmail.com>
committer: brandtbucher <brandtbuc...@gmail.com>
date: 2024-09-06T09:02:32-07:00
summary:

[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 <savannahostrow...@gmail.com>

files:
A 
Misc/NEWS.d/next/Core_and_Builtins/2024-09-01-00-02-05.gh-issue-123545.8nQNbL.rst
M Python/bytecodes.c
M Python/executor_cases.c.h

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 00000000000000..4da4151416d13c
--- /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 d9533110af20ed..1e6185d3c9e489 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 799f3b7f69239a..df7c19a80e40c5 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);

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to