Skip to content

Commit 223c03a

Browse files
gh-121082: Fix build failure when the developer use --enable-pystats arguments in configuration command after #118450 (#121083)
Signed-off-by: Manjusaka <[email protected]> Co-authored-by: Ken Jin <[email protected]>
1 parent b7a95df commit 223c03a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix build failure when the developer use ``--enable-pystats`` arguments in configuration command after #118450.

Python/specialize.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -2364,7 +2364,8 @@ _Py_Specialize_ForIter(_PyStackRef iter, _Py_CODEUNIT *instr, int oparg)
23642364
assert(ENABLE_SPECIALIZATION);
23652365
assert(_PyOpcode_Caches[FOR_ITER] == INLINE_CACHE_ENTRIES_FOR_ITER);
23662366
_PyForIterCache *cache = (_PyForIterCache *)(instr + 1);
2367-
PyTypeObject *tp = Py_TYPE(PyStackRef_AsPyObjectBorrow(iter));
2367+
PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter);
2368+
PyTypeObject *tp = Py_TYPE(iter_o);
23682369
if (tp == &PyListIter_Type) {
23692370
instr->op.code = FOR_ITER_LIST;
23702371
goto success;
@@ -2389,7 +2390,7 @@ _Py_Specialize_ForIter(_PyStackRef iter, _Py_CODEUNIT *instr, int oparg)
23892390
goto success;
23902391
}
23912392
SPECIALIZATION_FAIL(FOR_ITER,
2392-
_PySpecialization_ClassifyIterator(iter));
2393+
_PySpecialization_ClassifyIterator(iter_o));
23932394
failure:
23942395
STAT_INC(FOR_ITER, failure);
23952396
instr->op.code = FOR_ITER;

0 commit comments

Comments
 (0)