diff options
author | WildCard65 <WildCard65@users.noreply.github.com> | 2020-06-23 09:21:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 15:21:16 +0200 |
commit | 1d3dad5f96ed445b958ec53dfa0d46812f2162d9 (patch) | |
tree | 78b0a7a433fe841a2b1811c33284e4c6dd604d9b /Modules/arraymodule.c | |
parent | bpo-40521: Make the empty frozenset per interpreter (GH-21068) (diff) | |
download | cpython-1d3dad5f96ed445b958ec53dfa0d46812f2162d9.tar.gz cpython-1d3dad5f96ed445b958ec53dfa0d46812f2162d9.tar.bz2 cpython-1d3dad5f96ed445b958ec53dfa0d46812f2162d9.zip |
bpo-41085: Fix array.array.index() on 64-bit Windows (GH-21071)
Fix integer overflow in the :meth:`array.array.index` method on 64-bit Windows
for index larger than ``2**31``.
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r-- | Modules/arraymodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 8f12c616463..2d498c7e829 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -1130,7 +1130,7 @@ array_array_index(arrayobject *self, PyObject *v) cmp = PyObject_RichCompareBool(selfi, v, Py_EQ); Py_DECREF(selfi); if (cmp > 0) { - return PyLong_FromLong((long)i); + return PyLong_FromSsize_t(i); } else if (cmp < 0) return NULL; |