don't do pointer arithmetic with signed numbers
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 4ae22ef..e2d95ae 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -36,7 +36,8 @@
 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)