Closed Bug 1616277 Opened 4 years ago Closed 4 years ago

WeakRefMap::sweep unintentionally changes weak ref map data while sweeping

Categories

(Core :: JavaScript: GC, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

This doesn't matter too much because it only happens when the map entry is about to be removed, but WeakRefMap::sweep() uses a reference as the variable in the for loop that iterates over the vectors that are the map values, which means that we actually update the contents of the vector with the unwrapped objects in the following line.

This was causing assertions to fail when running the weak ref tests in the browser because we check that gray things are not assigned into HeapPtrs.

Blocks: 1616230
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b8bab151842e
Avoid unintentially changing the contents of the weak ref map while sweeping r=sfink
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: