Closed Bug 825395 Opened 7 years ago Closed 7 years ago

Add checking for interleaved nsCxPusher and JSAutoEnterCompartment

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: bholley, Assigned: bholley)

Details

Attachments

(1 file)

nsCxPusher is manually initialized (via Push()) and can be manually destroyed (via Pop()), so it isn't guaranteed to follow RAII patterns. This means it can get interleaved with a JSAutoCompartment. This, in turn, hoses us if the call to Push() triggered a call to JS_SaveFrameChain, because that stashes the old compartment situation and leaves us as if we hadn't entered a compartment at all.

This just bit me, so I spent some time making sure it wouldn't happen again. Patch forthcoming.
Comment on attachment 696462 [details] [diff] [review]
Add debug checking for interleaved nsCxPusher and JSAutoEnterCompartment. v1

r=me, but you probably need a js peer review on the jsfriendapi bits.
Attachment #696462 - Flags: review?(bzbarsky) → review+
Attachment #696462 - Flags: review?(luke)
Attachment #696462 - Flags: review?(luke) → review+
https://hg.mozilla.org/mozilla-central/rev/e194999b0d66
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.