Message372156
That's a bug in array_array_index() which downcasts "Py_ssize_t i" to long:
static PyObject *
array_array_index(arrayobject *self, PyObject *v)
/*[clinic end generated code: output=d48498d325602167 input=cf619898c6649d08]*/
{
Py_ssize_t i;
for (i = 0; i < Py_SIZE(self); i++) {
PyObject *selfi;
int cmp;
selfi = getarrayitem((PyObject *)self, i);
if (selfi == NULL)
return NULL;
cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
Py_DECREF(selfi);
if (cmp > 0) {
return PyLong_FromLong((long)i); // <===== HERE ===
}
else if (cmp < 0)
return NULL;
}
PyErr_SetString(PyExc_ValueError, "array.index(x): x not in array");
return NULL;
} |
|
Date |
User |
Action |
Args |
2020-06-23 10:47:37 | vstinner | set | recipients:
+ vstinner, paul.moore, tim.golden, SilentGhost, zach.ware, steve.dower, WildCard65 |
2020-06-23 10:47:37 | vstinner | set | messageid: <1592909257.55.0.857956504773.issue41085@roundup.psfhosted.org> |
2020-06-23 10:47:37 | vstinner | link | issue41085 messages |
2020-06-23 10:47:37 | vstinner | create | |
|