HACK: jsgc: check nullptr before call member function in mayBeOwnedByOtherRuntime()

This commit is contained in:
roytam1 2024-06-30 13:22:11 +08:00
commit f4188fb54e

View file

@ -6580,8 +6580,8 @@ JS::GCCellPtr::outOfLineKind() const
bool
JS::GCCellPtr::mayBeOwnedByOtherRuntime() const
{
return (is<JSString>() && as<JSString>().isPermanentAtom()) ||
(is<Symbol>() && as<Symbol>().isWellKnownSymbol());
return (is<JSString>() && &as<JSString>() && as<JSString>().isPermanentAtom()) ||
(is<Symbol>() && &as<Symbol>() && as<Symbol>().isWellKnownSymbol());
}
#ifdef JSGC_HASH_TABLE_CHECKS