summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-03-15 02:47:36 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-03-15 02:47:36 (GMT)
commitdfa822811a1a39cbf7cefc747b7b642a6c6e1357 (patch)
tree4a834ea6280068a53434469df4949b599fa7d6f2 /Objects/longobject.c
parentbdc4b02985e5d50301c554cb58b7f0ad24b1f68b (diff)
parent041c38a790cb9ce14742765e3314d90a7c601809 (diff)
downloadcpython-dfa822811a1a39cbf7cefc747b7b642a6c6e1357.zip
cpython-dfa822811a1a39cbf7cefc747b7b642a6c6e1357.tar.gz
cpython-dfa822811a1a39cbf7cefc747b7b642a6c6e1357.tar.bz2
merge 3.3
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 9411216..fb47c70 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -37,7 +37,8 @@ Py_ssize_t quick_int_allocs, quick_neg_int_allocs;
static PyObject *
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);
#ifdef COUNT_ALLOCS
if (ival >= 0)