Skip to content

Commit 5242044

Browse files
committed
[libcxx][AArch64][PAC] Fix std::type_info vtable discrimination
For non-Darwin targets, the vtable discrimination for `std::type_info` was not correct since `__arm64__` macro is defined only for Darwin. Use `__aarch64__` to fix ifdef for non-Darwin.
1 parent b13997b commit 5242044

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libcxx/include/typeinfo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,9 @@ struct __type_info_implementations {
299299
__impl;
300300
};
301301

302-
#if defined(__arm64__) && __has_cpp_attribute(clang::ptrauth_vtable_pointer)
302+
#if (defined(__arm64__) || defined(__aarch64__)) && \
303+
__has_feature(ptrauth_calls) && \
304+
__has_cpp_attribute(clang::ptrauth_vtable_pointer)
303305
#define _LIBCPP_TYPE_INFO_VTABLE_POINTER_AUTH \
304306
[[clang::ptrauth_vtable_pointer(process_independent, no_address_discrimination, no_extra_discrimination)]]
305307
#else

0 commit comments

Comments
 (0)