[libcxx-commits] [libcxx] [libcxxabi] [libc++][libc++abi] Minor follow-up changes after ptrauth upstreaming (PR #87481)

Daniil Kovalev via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 18 00:54:48 PDT 2024


================
@@ -275,13 +275,15 @@ struct __type_info_implementations {
           __impl;
 };
 
-#    if defined(__arm64__) && __has_cpp_attribute(clang::ptrauth_vtable_pointer)
-#      if __has_feature(ptrauth_type_info_discriminated_vtable_pointer)
+#    if __has_cpp_attribute(_Clang::__ptrauth_vtable_pointer__) && __has_feature(__ptrauth_calls__)
+#      if __has_feature(__ptrauth_vtable_address_discrimination__) ||                                                  \
+          __has_feature(__ptrauth_vtable_type_discrimination__)
----------------
kovdan01 wrote:

@ahmedbougacha As far as I understood, you are OK with current implementation present in this PR. It enables type+address discrimination for type info vtable pointers when we have `__has_feature(__ptrauth_vtable_address_discrimination__) || __has_feature(__ptrauth_vtable_type_discrimination__)`. Is this really the thing we want to? I'm a bit concerned with this since I've never seen support for discriminating type info vtable pointers (although I understand that you have that already), and the condition present in the PR will enable such discrimination while mainline clang does not support that yet.

Previously, the condition was `__has_feature(ptrauth_type_info_discriminated_vtable_pointer)`, and I think it's better since it does not affect type info vtable pointers discrimination unless it's really implemented on clang side.

https://github.com/llvm/llvm-project/pull/87481


More information about the libcxx-commits mailing list