don't do pointer arithmetic with signed numbers
This commit is contained in:
parent
e5cb836d4c
commit
041c38a790
|
@ -36,7 +36,8 @@ Py_ssize_t quick_int_allocs, quick_neg_int_allocs;
|
||||||
static PyObject *
|
static PyObject *
|
||||||
get_small_int(sdigit ival)
|
get_small_int(sdigit ival)
|
||||||
{
|
{
|
||||||
PyObject *v = (PyObject*)(small_ints + ival + NSMALLNEGINTS);
|
assert(-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS);
|
||||||
|
PyObject *v = (PyObject *)&small_ints[ival + NSMALLNEGINTS];
|
||||||
Py_INCREF(v);
|
Py_INCREF(v);
|
||||||
#ifdef COUNT_ALLOCS
|
#ifdef COUNT_ALLOCS
|
||||||
if (ival >= 0)
|
if (ival >= 0)
|
||||||
|
|
Loading…
Reference in New Issue