Bug 1894442 - Allow shared atoms zone when checking weakmap keys r=sfink

This was an over-strict assertion getting the weakmap key's zone, which can
legitimately be the shared atoms zone.

Differential Revision: https://phabricator.services.mozilla.com/D209204
This commit is contained in:
Jon Coppeard 2024-05-02 16:52:40 +00:00
parent 6c78db7df6
commit 1789fc93d7
2 changed files with 8 additions and 1 deletions

View File

@ -402,7 +402,8 @@ void WeakMap<K, V>::checkAfterMovingGC() const {
gc::Cell* value = gc::ToMarkable(r.front().value());
CheckGCThingAfterMovingGC(key);
if (!allowKeysInOtherZones()) {
MOZ_RELEASE_ASSERT(key->zone() == zone() || key->zone()->isAtomsZone());
Zone* keyZone = key->zoneFromAnyThread();
MOZ_RELEASE_ASSERT(keyZone == zone() || keyZone->isAtomsZone());
}
CheckGCThingAfterMovingGC(value, zone());
auto ptr = lookupUnbarriered(r.front().key());

View File

@ -0,0 +1,6 @@
// |jit-test| --enable-symbols-as-weakmap-keys; skip-if: helperThreadCount() === 0 || getBuildConfiguration("release_or_beta")
evalInWorker(`
a = new WeakSet
a.add(Symbol.hasInstance)
gczeal(14)(0 .b)
`)