[webkit-reviews] review granted: [Bug 206804] Introduce a getVTablePointer() utility function. : [Attachment 388787] proposed patch.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 25 14:05:16 PST 2020


Yusuke Suzuki <ysuzuki at apple.com> has granted Mark Lam <mark.lam at apple.com>'s
request for review:
Bug 206804: Introduce a getVTablePointer() utility function.
https://bugs.webkit.org/show_bug.cgi?id=206804

Attachment 388787: proposed patch.

https://bugs.webkit.org/attachment.cgi?id=388787&action=review




--- Comment #3 from Yusuke Suzuki <ysuzuki at apple.com> ---
Comment on attachment 388787
  --> https://bugs.webkit.org/attachment.cgi?id=388787
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=388787&action=review

> Source/WTF/wtf/PointerPreparations.h:40
> +#if __has_builtin(__builtin_get_vtable_pointer)
> +#define getVTablePointer(o) __builtin_get_vtable_pointer(o)
> +#else
> +#define getVTablePointer(o)
__builtin_ptrauth_auth(*(reinterpret_cast<void**>(o)),
ptrauth_key_cxx_vtable_pointer, 0)
> +#endif

Is it supported in newer clang? This is out of this patch's scope, but I was
considering that whether we can just use `__builtin_get_vtable_pointer` to
determine a lot of C++ WebCore class types.


More information about the webkit-reviews mailing list