From: H.J. Lu Date: Wed, 26 Apr 2023 23:34:08 +0000 (-0700) Subject: [sanitizer] Correct alignment of x32 __sanitizer_siginfo X-Git-Tag: upstream/17.0.6~10253 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05551c6582693c2b494ed8c30a46ea5969b507b1;p=platform%2Fupstream%2Fllvm.git [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 --- 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 cfca7bdedbe5..e6f298c26e1f 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