aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ralloc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/ralloc.c b/src/ralloc.c
index 3fa32ba9fea..8cf2c2b1b86 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -175,13 +175,11 @@ find_heap (void *address)
175{ 175{
176 heap_ptr heap; 176 heap_ptr heap;
177 177
178 for (heap = last_heap; heap; heap = heap->prev) 178 for (heap = last_heap; ; heap = heap->prev)
179 { 179 {
180 if (heap->start <= address && address <= heap->end) 180 if (heap->start <= address && address <= heap->end)
181 return heap; 181 return heap;
182 } 182 }
183
184 return NIL_HEAP;
185} 183}
186 184
187/* Find SIZE bytes of space in a heap. 185/* Find SIZE bytes of space in a heap.
@@ -509,10 +507,8 @@ update_heap_bloc_correspondence (bloc_ptr bloc, heap_ptr heap)
509 { 507 {
510 /* Advance through heaps, marking them empty, 508 /* Advance through heaps, marking them empty,
511 till we get to the one that B is in. */ 509 till we get to the one that B is in. */
512 while (heap) 510 while (! (heap->bloc_start <= b->data && b->data <= heap->end))
513 { 511 {
514 if (heap->bloc_start <= b->data && b->data <= heap->end)
515 break;
516 heap = heap->next; 512 heap = heap->next;
517 /* We know HEAP is not null now, 513 /* We know HEAP is not null now,
518 because there has to be space for bloc B. */ 514 because there has to be space for bloc B. */