Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 57b17ad

Browse files
committed
Add one more assert that indirectly interlocking conditions are consistent
with each other.
1 parent 4c5be0c commit 57b17ad

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Objects/obmalloc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ _PyMalloc_Free(void *p)
686686
* was full and is in no list -- it's not in the freeblocks
687687
* list in any case).
688688
*/
689+
assert(pool->ref.count > 0); /* else it was empty */
689690
*(block **)p = lastfree = pool->freeblock;
690691
pool->freeblock = (block *)p;
691692
if (lastfree) {

0 commit comments

Comments
 (0)