]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-123545: Remove duplicate Py_DECREF when handling _PyOptimizer_Optimize errors...
authorSavannah Ostrowski <savannahostrowski@gmail.com>
Thu, 5 Sep 2024 17:56:07 +0000 (10:56 -0700)
committerGitHub <noreply@github.com>
Thu, 5 Sep 2024 17:56:07 +0000 (10:56 -0700)
Misc/NEWS.d/next/Core_and_Builtins/2024-09-01-00-02-05.gh-issue-123545.8nQNbL.rst [new file with mode: 0644]
Python/bytecodes.c
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 (file)
index 0000000..4da4151
--- /dev/null
@@ -0,0 +1 @@
+Fix a double decref in rare cases on experimental JIT builds.
index c4cc8127bafbb4e6766786e61b64a95b117c6c8a..b5a642dccd2aec780f447e802e0770f30857d5a5 100644 (file)
@@ -4739,8 +4739,6 @@ dummy_func(
                     if (optimized <= 0) {
                         exit->temperature = restart_backoff_counter(temperature);
                         if (optimized < 0) {
-                            Py_DECREF(current_executor);
-                            tstate->previous_executor = Py_None;
                             GOTO_UNWIND();
                         }
                         tstate->previous_executor = (PyObject *)current_executor;
@@ -4822,8 +4820,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);
index d4be7904a50c102115decb394f349f17a6fb36da..6d687bbb48b0ba6a36e765528f53ddb1a8f40488 100644 (file)
                     if (optimized <= 0) {
                         exit->temperature = restart_backoff_counter(temperature);
                         if (optimized < 0) {
-                            Py_DECREF(current_executor);
-                            tstate->previous_executor = Py_None;
                             GOTO_UNWIND();
                         }
                         tstate->previous_executor = (PyObject *)current_executor;
                 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);