Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index eba313d283cdd21e08f7214e1cafd35079b35562..81ad774140ba2e95428994e47dce7f0b5cd579fe 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -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); |