diff --git a/src/heap/cppgc-js/cpp-heap.cc b/src/heap/cppgc-js/cpp-heap.cc index ec5aa5382e..c0c18e5b34 100644 --- a/src/heap/cppgc-js/cpp-heap.cc +++ b/src/heap/cppgc-js/cpp-heap.cc @@ -75,7 +75,9 @@ class V8ToCppGCReferencesVisitor final const internal::JSObject js_object = *reinterpret_cast(value); - if (!js_object.ptr() || !js_object.MayHaveEmbedderFields()) return; + if (!js_object.ptr() || js_object.IsSmi() || + !js_object.MayHaveEmbedderFields()) + return; internal::LocalEmbedderHeapTracer::WrapperInfo info; if (!internal::LocalEmbedderHeapTracer::ExtractWrappableInfo(