[Webkit-unassigned] [Bug 188799] WeakPtr breaks vtables when upcasting to base classes
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Aug 21 16:54:49 PDT 2018
https://bugs.webkit.org/show_bug.cgi?id=188799
--- Comment #3 from Jer Noble <jer.noble at apple.com> ---
A quick first-pass fix for this would be to add an assert to weak_reference_upcast():
ASSERT(static_cast<T*>(weakReference->get()) == reinterpret_cast<T*>(weakReference->get()));
Just having this assert in place in a debug builds yields a compilation error when trying to do a dangerous upcast. (I couldn't find a static_assert() that correctly generates a compile error.)
--
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/20180821/0c06523f/attachment.html>
More information about the webkit-unassigned
mailing list