summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorNadeshiko Manju <me@manjusaka.me>2024-06-27 11:35:25 (GMT)
committerGitHub <noreply@github.com>2024-06-27 11:35:25 (GMT)
commit223c03a43c010cf4404f2a42efafe587646a0619 (patch)
treea10ba13b654fe95b598d0edb75a3190dd7855ab4 /Python
parentb7a95dfee30aae171de47f98ed3b7d1cc08e5bd4 (diff)
downloadcpython-223c03a43c010cf4404f2a42efafe587646a0619.zip
cpython-223c03a43c010cf4404f2a42efafe587646a0619.tar.gz
cpython-223c03a43c010cf4404f2a42efafe587646a0619.tar.bz2
gh-121082: Fix build failure when the developer use `--enable-pystats` arguments in configuration command after #118450 (#121083)
Signed-off-by: Manjusaka <me@manjusaka.me> Co-authored-by: Ken Jin <kenjin4096@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/specialize.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index dc0e319..497feca 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -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;