| Index: src/heap/mark-compact.cc
|
| diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
|
| index 08472e5b10448949ef761f91de3fbdaedeead34b..c5c68c61e0ce1f79c683dece7c3756ccc817eb12 100644
|
| --- a/src/heap/mark-compact.cc
|
| +++ b/src/heap/mark-compact.cc
|
| @@ -2266,8 +2266,9 @@ void MarkCompactCollector::VisitAllObjects(HeapObjectVisitor* visitor) {
|
| SpaceIterator space_it(heap());
|
| HeapObject* obj = nullptr;
|
| while (space_it.has_next()) {
|
| - ObjectIterator* it = space_it.next();
|
| - while ((obj = it->Next()) != nullptr) {
|
| + std::unique_ptr<ObjectIterator> it(space_it.next()->GetObjectIterator());
|
| + ObjectIterator* obj_it = it.get();
|
| + while ((obj = obj_it->Next()) != nullptr) {
|
| visitor->Visit(obj);
|
| }
|
| }
|
|
|