diff options
-rw-r--r-- | Objects/listobject.c | 2 | ||||
-rw-r--r-- | Objects/longobject.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index 7d3732d..f0dc77d 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -2043,7 +2043,7 @@ fail: if (keys != NULL) { for (i = 0; i < saved_ob_size; i++) Py_DECREF(keys[i]); - if (keys != &ms.temparray[saved_ob_size+1]) + if (saved_ob_size >= MERGESTATE_TEMP_SIZE/2) PyMem_FREE(keys); } diff --git a/Objects/longobject.c b/Objects/longobject.c index fb47c70..7036c0e 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -37,8 +37,9 @@ Py_ssize_t quick_int_allocs, quick_neg_int_allocs; static PyObject * get_small_int(sdigit ival) { + PyObject *v; assert(-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS); - PyObject *v = (PyObject *)&small_ints[ival + NSMALLNEGINTS]; + v = (PyObject *)&small_ints[ival + NSMALLNEGINTS]; Py_INCREF(v); #ifdef COUNT_ALLOCS if (ival >= 0) |