diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-13 18:13:02 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-13 18:13:02 (GMT) |
commit | ccc56c7c96bfdc5776a472a89da6e0b4ae865104 (patch) | |
tree | 2d2f286beeeb9020b256d07fb490ea2e257f8dc1 | |
parent | 20745b1a709daa25ff2a842b3a64e092b38ab519 (diff) | |
download | cpython-ccc56c7c96bfdc5776a472a89da6e0b4ae865104.zip cpython-ccc56c7c96bfdc5776a472a89da6e0b4ae865104.tar.gz cpython-ccc56c7c96bfdc5776a472a89da6e0b4ae865104.tar.bz2 |
Really address the issue of where to place the assert for leftblock.
(Followup of Klocwork 274)
-rw-r--r-- | Modules/collectionsmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |