[Python-checkins] r51255 - python/trunk/Modules/collectionsmodule.c

neal.norwitz python-checkins at python.org
Sun Aug 13 20:13:03 CEST 2006


Author: neal.norwitz
Date: Sun Aug 13 20:13:02 2006
New Revision: 51255

Modified:
   python/trunk/Modules/collectionsmodule.c
Log:
Really address the issue of where to place the assert for leftblock.
(Followup of Klocwork 274)



Modified: python/trunk/Modules/collectionsmodule.c
==============================================================================
--- python/trunk/Modules/collectionsmodule.c	(original)
+++ python/trunk/Modules/collectionsmodule.c	Sun Aug 13 20:13:02 2006
@@ -211,6 +211,7 @@
 		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->leftindex = CENTER + 1;
 			deque->rightindex = CENTER;
 		} else {
-			assert(deque->leftblock != NULL);
 			assert(deque->leftblock != deque->rightblock);
 			prevblock = deque->leftblock->rightlink;
 			PyMem_Free(deque->leftblock);


More information about the Python-checkins mailing list