Index: src/heap/mark-compact.cc |
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc |
index 37651e7133eb9c367b1cdff17e7a2df5b73ddadf..f2b2ce171a9b6aca5d6152ba44422f8374b7317c 100644 |
--- a/src/heap/mark-compact.cc |
+++ b/src/heap/mark-compact.cc |
@@ -3060,6 +3060,11 @@ void MarkCompactCollector::EvacuatePages() { |
// have an emergency page and the space still has room for that. |
if (space->HasEmergencyMemory() && space->CanExpand()) { |
EvacuateLiveObjectsFromPage(p); |
+ // Unlink the page from the list of pages here. We must not iterate |
+ // over that page later (e.g. when scan on scavenge pages are |
+ // processed). The page itself will be freed later and is still |
+ // reachable from the evacuation candidates list. |
+ p->Unlink(); |
} else { |
// Without room for expansion evacuation is not guaranteed to succeed. |
// Pessimistically abandon unevacuated pages. |