Fix heap snapshot crash when JSArrayBuffer has no backing_store.
authoralph@chromium.org <alph@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 17 Feb 2014 12:39:01 +0000 (12:39 +0000)
committeralph@chromium.org <alph@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 17 Feb 2014 12:39:01 +0000 (12:39 +0000)
LOG=N
BUG=344239
R=dslomov@chromium.org, yurys@chromium.org

Review URL: https://codereview.chromium.org/169393004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19407 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/heap-snapshot-generator.cc

index 71362ff..8a9b0d6 100644 (file)
@@ -1464,6 +1464,8 @@ void V8HeapExplorer::ExtractJSArrayBufferReferences(
                    "weak_first_view", buffer->weak_first_view(),
                    JSArrayBuffer::kWeakFirstViewOffset);
   // Setup a reference to a native memory backing_store object.
+  if (!buffer->backing_store())
+    return;
   size_t data_size = NumberToSize(heap_->isolate(), buffer->byte_length());
   CHECK(data_size <= static_cast<size_t>(kMaxInt));
   HeapEntry* data_entry = AddEntry(