[compiler-rt] [Sanitizers][ABI] Remove too strong assert in asan_abi_shim (PR #81696)

Mariusz Borsa via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 19:37:37 PST 2024


https://github.com/wrotki created https://github.com/llvm/llvm-project/pull/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


>From 7bc81430a9fef6da4b82e0d67d6ad79cc1bc2860 Mon Sep 17 00:00:00 2001
From: Mariusz Borsa <m_borsa at apple.com>
Date: Tue, 13 Feb 2024 19:33:55 -0800
Subject: [PATCH] [Sanitizers][ABI] Remove too strong assert in asan_abi_shim

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
---
 compiler-rt/lib/asan_abi/asan_abi_shim.cpp | 1 -
 1 file changed, 1 deletion(-)

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);
 



More information about the llvm-commits mailing list