Skip to content

Commit

Permalink
Fix build failure when the developer use --enable-pystats arguments…
Browse files Browse the repository at this point in the history
… in configuration command after python#118450

Signed-off-by: Manjusaka <[email protected]>
  • Loading branch information
Zheaoli committed Jun 27, 2024
1 parent 12af8ec commit 67a8f6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix build failure when the developer use `--enable-pystats` arguments in configuration command after #118450
5 changes: 3 additions & 2 deletions Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *iterObject = PyStackRef_AsPyObjectBorrow(iter);
PyTypeObject *tp = Py_TYPE(iterObject);
if (tp == &PyListIter_Type) {
instr->op.code = FOR_ITER_LIST;
goto success;
Expand All @@ -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(iterObject));
failure:
STAT_INC(FOR_ITER, failure);
instr->op.code = FOR_ITER;
Expand Down

0 comments on commit 67a8f6f

Please sign in to comment.