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)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: terrence, Assigned: terrence)
References
Details
(Whiteboard: [qa-])
Attachments
(1 file)
2.06 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
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)
Comment 1•11 years ago
|
||
> 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 2•11 years ago
|
||
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+
Comment 3•11 years ago
|
||
...and I think it is ok to just move the thing to be before dom::RootedDictionary
Assignee | ||
Comment 4•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•11 years ago
|
Whiteboard: [qa-]
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•