Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dfa8228

Browse files
committed
merge 3.3
2 parents bdc4b02 + 041c38a commit dfa8228

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Objects/longobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ Py_ssize_t quick_int_allocs, quick_neg_int_allocs;
3737
static PyObject *
3838
get_small_int(sdigit ival)
3939
{
40-
PyObject *v = (PyObject*)(small_ints + ival + NSMALLNEGINTS);
40+
assert(-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS);
41+
PyObject *v = (PyObject *)&small_ints[ival + NSMALLNEGINTS];
4142
Py_INCREF(v);
4243
#ifdef COUNT_ALLOCS
4344
if (ival >= 0)

0 commit comments

Comments
 (0)