diff --git a/libcxx/src/include/overridable_function.h b/libcxx/src/include/overridable_function.h index e83ca7be7befa..6c70f6242ddd6 100644 --- a/libcxx/src/include/overridable_function.h +++ b/libcxx/src/include/overridable_function.h @@ -116,6 +116,11 @@ _LIBCPP_HIDE_FROM_ABI bool __is_function_overridden(_Ret (*__fptr)(_Args...)) no uintptr_t __end = reinterpret_cast(&__stop___lcxx_override); uintptr_t __ptr = reinterpret_cast(__fptr); +# if __has_feature(ptrauth_calls) + // We must pass a void* to ptrauth_strip since it only accepts a pointer type. See full explanation above. + __ptr = reinterpret_cast(ptrauth_strip(reinterpret_cast(__ptr), ptrauth_key_function_pointer)); +# endif + return __ptr < __start || __ptr > __end; } _LIBCPP_END_NAMESPACE_STD