Closed Bug 932466 Opened 11 years ago Closed 11 years ago

Fix two trivial exact rooting hazards in dom

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: terrence, Assigned: terrence)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

I'm not entirely sure how dom::RootedDictionary is supposed to GC, but it's simple enough to just swap the declaration order.
Attachment #824227 - Flags: review?(bugs)
> I'm not entirely sure how dom::RootedDictionary is supposed to GC It can't, but the analysis can't figure that out. What it sees is that RootedDictionary<MediaTrackConstraints>::RootedDictionary calls MediaTrackConstraints::MediaTrackConstraints, which calls MediaTrackConstraints::Init(nullptr, JS::NullHandleValue). Now if you look at Init(), it has: // Passing a null JSContext is OK only if we're initing from null, // Since in that case we will not have to do any property gets MOZ_ASSERT_IF(!cx, val.isNull()); ... bool isNull = val.isNullOrUndefined(); and then a bunch of code like this: if (!isNull && !JS_GetPropertyById(cx, &val.toObject(), atomsCache->mandatory_id, &temp.ref())) { return false; } which can clearly gc... but not when called with val as a NullValue. So it's a false positive, but a somewhat non-obvious one.
Comment on attachment 824227 [details] [diff] [review] hazards_misc_browser-v0.diff > >- JS::Value result; >+ JS::RootedValue result(aCx); JS::Rooted<JS::Value> for now
Attachment #824227 - Flags: review?(bugs) → review+
...and I think it is ok to just move the thing to be before dom::RootedDictionary
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: