aboutsummaryrefslogtreecommitdiff
path: root/libcxx/src
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2024-07-23 13:04:54 -0500
committerGitHub <noreply@github.com>2024-07-23 14:04:54 -0400
commite64e745e8fb802ffb06259b1a5ba3db713a17087 (patch)
tree45cd0d21ac54ef0829be75738711e2bd15dc3b07 /libcxx/src
parentc92d9b06d45d437e97b966927aba2de37a5d6e56 (diff)
downloadllvm-e64e745e8fb802ffb06259b1a5ba3db713a17087.zip
llvm-e64e745e8fb802ffb06259b1a5ba3db713a17087.tar.gz
llvm-e64e745e8fb802ffb06259b1a5ba3db713a17087.tar.bz2
[libc++][libc++abi] Minor follow-up changes after ptrauth upstreaming (#87481)
This patch applies the comments provided on #84573. This is done as a separate PR to avoid merge conflicts with downstreams that already had ptrauth support.
Diffstat (limited to 'libcxx/src')
-rw-r--r--libcxx/src/include/overridable_function.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/src/include/overridable_function.h b/libcxx/src/include/overridable_function.h
index e71e4f1..c7639f5 100644
--- a/libcxx/src/include/overridable_function.h
+++ b/libcxx/src/include/overridable_function.h
@@ -13,7 +13,7 @@
#include <__config>
#include <cstdint>
-#if defined(__arm64e__) && __has_feature(ptrauth_calls)
+#if __has_feature(ptrauth_calls)
# include <ptrauth.h>
#endif
@@ -83,13 +83,13 @@ _LIBCPP_HIDE_FROM_ABI bool __is_function_overridden(_Ret (*__fptr)(_Args...)) no
uintptr_t __end = reinterpret_cast<uintptr_t>(&__lcxx_override_end);
uintptr_t __ptr = reinterpret_cast<uintptr_t>(__fptr);
-#if defined(__arm64e__) && __has_feature(ptrauth_calls)
+# if __has_feature(ptrauth_calls)
// We must pass a void* to ptrauth_strip since it only accepts a pointer type. Also, in particular,
// we must NOT pass a function pointer, otherwise we will strip the function pointer, and then attempt
// to authenticate and re-sign it when casting it to a uintptr_t again, which will fail because we just
// stripped the function pointer. See rdar://122927845.
__ptr = reinterpret_cast<uintptr_t>(ptrauth_strip(reinterpret_cast<void*>(__ptr), ptrauth_key_function_pointer));
-#endif
+# endif
// Finally, the function was overridden if it falls outside of the section's bounds.
return __ptr < __start || __ptr > __end;