Stop allowing implicit downcasts in StrongOrRawPtr

RESOLVED FIXED in Firefox 61

Status

()

enhancement
P2
normal
RESOLVED FIXED
Last year
5 months ago

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Tracking

unspecified
mozilla61
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox61 fixed)

Details

Attachments

(1 attachment)

Given the way the StrongOrRawPtr(already_AddRefed<S>&& aPtr) ctor does a downcast, you can do things like:

  interface Foo {
    Element bar();
  };

and then have Foo::bar() return already_AddRefed<nsINode> and this will compile.  This is obviously not good.  ;)

Luckily we have only two things that are relying on this behavior, and both are actually safe.  One is being removed in bug 1446246 and the other is simple to fix.
Priority: -- → P2
Attachment #8960780 - Flags: review?(peterv) → review+
Bug 888600 introduced new failures of this sort, but I think bug 1448850 will remove them again....
Depends on: 1448850
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5cc5f9c978a3
Stop allowing implicit downcasts in StrongOrRawPtr.  r=peterv
https://hg.mozilla.org/mozilla-central/rev/5cc5f9c978a3
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.