mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
[3.13] gh-126595: fix a crash when calling itertools.count(sys.maxsize)
(GH-126617) (#126739)
gh-126595: fix a crash when calling `itertools.count(sys.maxsize)` (GH-126617)
(cherry picked from commit 6e3bb8a913
)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
parent
2da063e0b2
commit
865f096f51
3 changed files with 13 additions and 0 deletions
|
@ -4075,6 +4075,9 @@ itertools_count_impl(PyTypeObject *type, PyObject *long_cnt,
|
|||
PyErr_Clear();
|
||||
fast_mode = 0;
|
||||
}
|
||||
else if (cnt == PY_SSIZE_T_MAX) {
|
||||
fast_mode = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cnt = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue