Skip to content

Commit

Permalink
Bug 1894442 - Allow shared atoms zone when checking weakmap keys r=sfink
Browse files Browse the repository at this point in the history
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

UltraBlame original commit: 62df6f06d6c6b340080abc282824ff30ce05743d
  • Loading branch information
marco-c committed Jun 16, 2024
1 parent 5464ff6 commit 83d89f9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
19 changes: 10 additions & 9 deletions js/src/gc/WeakMap-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2470,27 +2470,28 @@ allowKeysInOtherZones
)
)
{
MOZ_RELEASE_ASSERT
(
Zone
*
keyZone
=
key
-
>
zone
zoneFromAnyThread
(
)
;
MOZ_RELEASE_ASSERT
(
keyZone
=
=
zone
(
)
|
|
key
-
>
zone
(
)
keyZone
-
>
isAtomsZone
Expand Down
24 changes: 24 additions & 0 deletions js/src/jit-test/tests/gc/bug-1894442.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
evalInWorker
(
a
=
new
WeakSet
a
.
add
(
Symbol
.
hasInstance
)
gczeal
(
14
)
(
0
.
b
)
)

0 comments on commit 83d89f9

Please sign in to comment.