* src/mem/ralloc.c (update_heap_bloc_correspondence): Be extra
safe and do "abort" on violation of stated (in comment) invariant.
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
heap = heap->next;
/* We know HEAP is not null now,
because there has to be space for bloc B. */
- heap->first_bloc = NIL_BLOC;
- heap->last_bloc = NIL_BLOC;
- heap->free = heap->bloc_start;
+ if ( heap ) {
+ /* But we still tested it... */
+ heap->first_bloc = NIL_BLOC;
+ heap->last_bloc = NIL_BLOC;
+ heap->free = heap->bloc_start;
+ } else {
+ /* ... and now abort if proven
+ otherwise...
+ */
+ abort();
+ }
}
if (heap == NULL)
break;