mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Issue #14829: Fix bisect and range() indexing with large indices (>= 2 ** 32) under 64-bit Windows.
(untested, because of Windows build issues under 3.x)
This commit is contained in:
commit
b7d033db78
3 changed files with 6 additions and 3 deletions
|
@ -34,6 +34,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #14829: Fix bisect and range() indexing with large indices
|
||||||
|
(>= 2 ** 32) under 64-bit Windows.
|
||||||
|
|
||||||
- Issue #14732: The _csv module now uses PEP 3121 module initialization.
|
- Issue #14732: The _csv module now uses PEP 3121 module initialization.
|
||||||
Patch by Robin Schreiber.
|
Patch by Robin Schreiber.
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru).
|
Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define PY_SSIZE_T_CLEAN
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
|
||||||
static Py_ssize_t
|
static Py_ssize_t
|
||||||
|
@ -195,8 +196,7 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw)
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
_Py_IDENTIFIER(insert);
|
_Py_IDENTIFIER(insert);
|
||||||
|
result = _PyObject_CallMethodId(list, &PyId_insert, "nO", index, item);
|
||||||
result = _PyObject_CallMethodId(list, &PyId_insert, "iO", index, item);
|
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
Py_DECREF(result);
|
Py_DECREF(result);
|
||||||
|
|
|
@ -308,7 +308,7 @@ compute_range_item(rangeobject *r, PyObject *arg)
|
||||||
static PyObject *
|
static PyObject *
|
||||||
range_item(rangeobject *r, Py_ssize_t i)
|
range_item(rangeobject *r, Py_ssize_t i)
|
||||||
{
|
{
|
||||||
PyObject *res, *arg = PyLong_FromLong(i);
|
PyObject *res, *arg = PyLong_FromSsize_t(i);
|
||||||
if (!arg) {
|
if (!arg) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue