From fefe91ce6a49b644e909faa92bee10814eaed729 Mon Sep 17 00:00:00 2001 From: jkummerow Date: Wed, 29 Apr 2015 02:03:06 -0700 Subject: [PATCH] Fix stale pointer issue in heap snapshot generator Review URL: https://codereview.chromium.org/1109153002 Cr-Commit-Position: refs/heads/master@{#28124} --- src/heap-snapshot-generator.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc index bae364c..654cda4 100644 --- a/src/heap-snapshot-generator.cc +++ b/src/heap-snapshot-generator.cc @@ -2471,6 +2471,9 @@ void NativeObjectsExplorer::SetNativeRootReference( FindOrAddGroupInfo(info->GetGroupLabel()); HeapEntry* group_entry = filler_->FindOrAddEntry(group_info, synthetic_entries_allocator_); + // |FindOrAddEntry| can move and resize the entries backing store. Reload + // potentially-stale pointer. + child_entry = filler_->FindEntry(info); filler_->SetNamedAutoIndexReference( HeapGraphEdge::kInternal, group_entry->index(), -- 2.7.4