Commit 64e06641 authored by mlippautz's avatar mlippautz Committed by Commit bot

[heap] Filter out nullptr when registering externally referenced objects

Ideally they are already filtered on the embedder side. Sometimes
howevever, embedders end up with a Local<T> pointing to a nullptr
object. In this case the best way to filter this is right at the
beginning of the registration process.

BUG=chromium:713667

Review-Url: https://codereview.chromium.org/2836013003
Cr-Commit-Position: refs/heads/master@{#44844}
parent e480b2b2
......@@ -5662,6 +5662,10 @@ void Heap::TracePossibleWrapper(JSObject* js_object) {
void Heap::RegisterExternallyReferencedObject(Object** object) {
HeapObject* heap_object = HeapObject::cast(*object);
if (heap_object == nullptr) {
// We might encounter non-empty handles that point to nullptr.
return;
}
DCHECK(Contains(heap_object));
if (FLAG_incremental_marking_wrappers && incremental_marking()->IsMarking()) {
IncrementalMarking::MarkGrey(this, heap_object);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment