[Webkit-unassigned] [Bug 188799] WeakPtr breaks vtables when upcasting to base classes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 23 09:58:12 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=188799

--- Comment #8 from Geoffrey Garen <ggaren at apple.com> ---
(In reply to Antti Koivisto from comment #7)
> > (b) Subclass inherits from multiple base classes.
> 
> Even in this case no fixup is needed for the first base class, right?

Right.

> That
> is, multiple inheritance is fine as long as the first base class provides
> the weak factory.

Partially right.

Multiple inheritance is fine as long as you're only going to cast to the first base class. (In that case, either the first base class or the subclass can provide the weak pointer factory.)

But if you need to be able to create a weak pointer to more than one base class, then you're stuck. If you provide a weak pointer factory in the subclass, then you need pointer fixup when you cast to the non-first base class. If you provide a weak pointer factory in the base classes, then you have multiple implementations of weakPtrFactory().

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180823/5192f2f0/attachment.html>


More information about the webkit-unassigned mailing list