Fix stale pointer issue in heap snapshot generator
authorjkummerow <jkummerow@chromium.org>
Wed, 29 Apr 2015 09:03:06 +0000 (02:03 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 29 Apr 2015 09:03:15 +0000 (09:03 +0000)
Review URL: https://codereview.chromium.org/1109153002

Cr-Commit-Position: refs/heads/master@{#28124}

src/heap-snapshot-generator.cc

index bae364c..654cda4 100644 (file)
@@ -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(),