The second assert in the following code from HeapRegionLinkedList::add_as_head(): if (_head != NULL) { assert(length() > 0 && _tail != NULL, hrs_ext_msg(this, "invariant")); from_list->_tail->set_next(_head); } else { assert(length() == 0 && _head == NULL, hrs_ext_msg(this, "invariant")); _tail = from_list->_tail; } _head = from_list->_head; is incorrect. The asert is checking that _head is NULL - when we already know it is NULL from negating the condition on the if-statment. The assertion should be checking that _tail is NULL (the invariant is that both should be NULL). Many thanks to Brandon Mitchell at Twitter for discovering and providing the fix for the issue.
|