diff options
author | Slava Gurevich <sgurevich@gmail.com> | 2025-08-08 09:36:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-08 09:36:22 -0700 |
commit | 0f59b8d4e3f8081c69b46f4693536e118fc0e9e6 (patch) | |
tree | de59e9463c313d711850232edab81552897f8e6f | |
parent | c96223434c64d32c3f397d20a8ed1d9749aae441 (diff) | |
download | llvm-0f59b8d4e3f8081c69b46f4693536e118fc0e9e6.zip llvm-0f59b8d4e3f8081c69b46f4693536e118fc0e9e6.tar.gz llvm-0f59b8d4e3f8081c69b46f4693536e118fc0e9e6.tar.bz2 |
Fix improper alignment of static buffer for placement-new of BufferQueue (#152408)
No behavioral change, but eliminates potential UB in strict-alignment
systems.
The previous commit (llvm#94171) bulk-updated alignment usage to C++23
spec, but missed this occurrence.
-rw-r--r-- | compiler-rt/lib/xray/xray_fdr_logging.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/xray/xray_fdr_logging.cpp b/compiler-rt/lib/xray/xray_fdr_logging.cpp index 7def356..977a0b9 100644 --- a/compiler-rt/lib/xray/xray_fdr_logging.cpp +++ b/compiler-rt/lib/xray/xray_fdr_logging.cpp @@ -73,7 +73,7 @@ static_assert(std::is_trivially_destructible<ThreadLocalData>::value, static pthread_key_t Key; // Global BufferQueue. -static std::byte BufferQueueStorage[sizeof(BufferQueue)]; +alignas(BufferQueue) static std::byte BufferQueueStorage[sizeof(BufferQueue)]; static BufferQueue *BQ = nullptr; // Global thresholds for function durations. |