Closed Bug 930625 Opened 11 years ago Closed 11 years ago

Fix several new exact rooting hazards in spidermonkey

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: terrence, Assigned: terrence)

References

Details

Attachments

(1 file)

A bunch of new hazards popped up throughout SpiderMonkey in the last couple of weeks. They were pretty much all just missing handles with a couple of missing roots for good measure.
Attachment #821786 - Flags: review?(sphink)
Comment on attachment 821786 [details] [diff] [review]
hazard_misc_sm-v0.diff

Review of attachment 821786 [details] [diff] [review]:
-----------------------------------------------------------------

Nice sweep through these, thanks!

::: js/src/jsapi-tests/testNullRoot.cpp
@@ +9,5 @@
>  
>  BEGIN_TEST(testNullRoot)
>  {
> +    JS::RootedObject obj(cx);
> +    CHECK(JS_AddObjectRoot(cx, obj.address()));

This is a little weird. The test makes more sense with a bare pointer.

Then again, I'd rather it be weird than have extra false positive hazards cluttering things up. The right thing would probably be some sort of analysis-visible annotation, but I don't care enough.
Attachment #821786 - Flags: review?(sphink) → review+
(In reply to Steve Fink [:sfink] from comment #1)
> This is a little weird. The test makes more sense with a bare pointer.

Yup :-). That said, the test is for AddRoot on a nullptr, so it's still testing the right thing. And it's now testing Rooted of a nullptr too, so I guess the test is even better now?
 
> Then again, I'd rather it be weird than have extra false positive hazards
> cluttering things up. The right thing would probably be some sort of
> analysis-visible annotation, but I don't care enough.

Agreed.

https://hg.mozilla.org/integration/mozilla-inbound/rev/be2e01347abd
https://hg.mozilla.org/mozilla-central/rev/be2e01347abd
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.