Index: src/heap/spaces.cc |
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc |
index 3802e470bd454a7da2680589f71bd31cb86ff37a..060052e706cf4196b907bb14c535ff4982392b37 100644 |
--- a/src/heap/spaces.cc |
+++ b/src/heap/spaces.cc |
@@ -1142,7 +1142,12 @@ void PagedSpace::ReleasePage(Page* page) { |
allocation_info_.set_limit(NULL); |
} |
- page->Unlink(); |
+ // If page is still in a list, unlink it from that list. |
+ if (page->next_chunk() != NULL) { |
+ DCHECK(page->prev_chunk() != NULL); |
+ page->Unlink(); |
+ } |
+ |
if (page->IsFlagSet(MemoryChunk::CONTAINS_ONLY_DATA)) { |
heap()->isolate()->memory_allocator()->Free(page); |
} else { |