]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-121082: Fix build failure when the developer use `--enable-pystats` arguments...
authorNadeshiko Manju <me@manjusaka.me>
Thu, 27 Jun 2024 11:35:25 +0000 (19:35 +0800)
committerGitHub <noreply@github.com>
Thu, 27 Jun 2024 11:35:25 +0000 (19:35 +0800)
Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
Misc/NEWS.d/next/Build/2024-06-27-18-03-20.gh-issue-121082.w3AfRx.rst [new file with mode: 0644]
Python/specialize.c

diff --git a/Misc/NEWS.d/next/Build/2024-06-27-18-03-20.gh-issue-121082.w3AfRx.rst b/Misc/NEWS.d/next/Build/2024-06-27-18-03-20.gh-issue-121082.w3AfRx.rst
new file mode 100644 (file)
index 0000000..7657672
--- /dev/null
@@ -0,0 +1 @@
+Fix build failure when the developer use ``--enable-pystats`` arguments in configuration command after #118450.
index dc0e319880b976167e6c5f651485e03322d94328..497feca06e4c7fc531cc6770d26ae1b8c9eacf81 100644 (file)
@@ -2364,7 +2364,8 @@ _Py_Specialize_ForIter(_PyStackRef iter, _Py_CODEUNIT *instr, int oparg)
     assert(ENABLE_SPECIALIZATION);
     assert(_PyOpcode_Caches[FOR_ITER] == INLINE_CACHE_ENTRIES_FOR_ITER);
     _PyForIterCache *cache = (_PyForIterCache *)(instr + 1);
-    PyTypeObject *tp = Py_TYPE(PyStackRef_AsPyObjectBorrow(iter));
+    PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter);
+    PyTypeObject *tp = Py_TYPE(iter_o);
     if (tp == &PyListIter_Type) {
         instr->op.code = FOR_ITER_LIST;
         goto success;
@@ -2389,7 +2390,7 @@ _Py_Specialize_ForIter(_PyStackRef iter, _Py_CODEUNIT *instr, int oparg)
         goto success;
     }
     SPECIALIZATION_FAIL(FOR_ITER,
-                        _PySpecialization_ClassifyIterator(iter));
+                        _PySpecialization_ClassifyIterator(iter_o));
 failure:
     STAT_INC(FOR_ITER, failure);
     instr->op.code = FOR_ITER;