From ccc56c7c96bfdc5776a472a89da6e0b4ae865104 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Sun, 13 Aug 2006 18:13:02 +0000 Subject: Really address the issue of where to place the assert for leftblock. (Followup of Klocwork 274) --- Modules/collectionsmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/collectionsmodule.c b/Modules/collectionsmodule.c index aef5d71..c1bd732 100644 --- a/Modules/collectionsmodule.c +++ b/Modules/collectionsmodule.c @@ -211,6 +211,7 @@ deque_popleft(dequeobject *deque, PyObject *unused) PyErr_SetString(PyExc_IndexError, "pop from an empty deque"); return NULL; } + assert(deque->leftblock != NULL); item = deque->leftblock->data[deque->leftindex]; deque->leftindex++; deque->len--; @@ -224,7 +225,6 @@ deque_popleft(dequeobject *deque, PyObject *unused) deque->leftindex = CENTER + 1; deque->rightindex = CENTER; } else { - assert(deque->leftblock != NULL); assert(deque->leftblock != deque->rightblock); prevblock = deque->leftblock->rightlink; PyMem_Free(deque->leftblock); -- cgit v0.12