[compiler-rt] 05551c6 - [sanitizer] Correct alignment of x32 __sanitizer_siginfo

H.J. Lu via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 18:29:06 PDT 2023


Author: H.J. Lu
Date: 2023-04-26T18:27:38-07:00
New Revision: 05551c6582693c2b494ed8c30a46ea5969b507b1

URL: https://github.com/llvm/llvm-project/commit/05551c6582693c2b494ed8c30a46ea5969b507b1
DIFF: https://github.com/llvm/llvm-project/commit/05551c6582693c2b494ed8c30a46ea5969b507b1.diff

LOG: [sanitizer] Correct alignment of x32 __sanitizer_siginfo

Since alignment of x32 siginfo_t is 8 bytes, not 4 bytes, use u64 in
__sanitizer_siginfo_pad to align x32 __sanitizer_siginfo to 8 bytes.

Fixes https://github.com/llvm/llvm-project/issues/62394

Differential Revision: https://reviews.llvm.org/D149309

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index cfca7bdedbe55..e6f298c26e1fb 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -578,8 +578,13 @@ struct __sanitizer_sigset_t {
 #endif
 
 struct __sanitizer_siginfo_pad {
+#if SANITIZER_X32
+  // x32 siginfo_t is aligned to 8 bytes.
+  u64 pad[128 / sizeof(u64)];
+#else
   // Require uptr, because siginfo_t is always pointer-size aligned on Linux.
   uptr pad[128 / sizeof(uptr)];
+#endif
 };
 
 #if SANITIZER_LINUX


        


More information about the llvm-commits mailing list