-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[Sanitizers][ABI] Remove too strong assert in asan_abi_shim #81696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Mariusz Borsa (wrotki) ChangesRecently we enabled building the shim for arm64_32 arch. On this arch, sizeof(uptr) == sizeof(unsigned long) == 4 - so this assert will fail in runtime. Need to just remove this assert rdar://122927166 Full diff: https://github.com/llvm/llvm-project/pull/81696.diff 1 Files Affected:
diff --git a/compiler-rt/lib/asan_abi/asan_abi_shim.cpp b/compiler-rt/lib/asan_abi/asan_abi_shim.cpp
index 35c45dff96f6d2..523b322618b850 100644
--- a/compiler-rt/lib/asan_abi/asan_abi_shim.cpp
+++ b/compiler-rt/lib/asan_abi/asan_abi_shim.cpp
@@ -54,7 +54,6 @@ void *__asan_memmove(void *dest, const void *src, uptr n) {
// Functions concerning RTL startup and initialization
void __asan_init(void) {
- static_assert(sizeof(uptr) == 8);
static_assert(sizeof(u64) == 8);
static_assert(sizeof(u32) == 4);
|
Suggestion: relax the assertion to |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. It was predictive for this very moment, but then there was no good reason to assume anything about it's size in the first place so was an overly restrictive in the first place.
Recently we enabled building the shim for arm64_32 arch. On this arch, sizeof(uptr) == sizeof(unsigned long) == 4 - so this assert will fail in runtime. Relaxing the assert per suggestion on the PR rdar://122927166
7bc8143
to
5ec31f0
Compare
Sure, will do that, thanks!
Did that, thanks for the suggestion! |
Recently we enabled building the shim for arm64_32 arch. On this arch, sizeof(uptr) == sizeof(unsigned long) == 4 - so this assert will fail in runtime. Need to just remove this assert rdar://122927166 Co-authored-by: Mariusz Borsa <[email protected]> (cherry picked from commit 3f738a4)
[Sanitizers][ABI] Remove too strong assert in asan_abi_shim (llvm#81696)
Recently we enabled building the shim for arm64_32 arch. On this arch, sizeof(uptr) == sizeof(unsigned long) == 4 - so this assert will fail in runtime.
Need to just remove this assert
rdar://122927166