summaryrefslogtreecommitdiff
path: root/src/runtime/mheap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/mheap.c')
-rw-r--r--src/runtime/mheap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/mheap.c b/src/runtime/mheap.c
index 64af8e741..362719434 100644
--- a/src/runtime/mheap.c
+++ b/src/runtime/mheap.c
@@ -228,6 +228,8 @@ MHeap_LookupMaybe(MHeap *h, PageID p)
s = MHeapMap_GetMaybe(&h->map, p);
if(s == nil || p < s->start || p - s->start >= s->npages)
return nil;
+ if(s->state != MSpanInUse)
+ return nil;
return s;
}