From 3b9a0884ba75098789e057cd6f4f29e84b6eca2c Mon Sep 17 00:00:00 2001 From: Slava Gurevich <108763208+noclowns@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:24:11 -0700 Subject: [PATCH] Fix improper alignment of static buffer for placement-new of BufferQueue 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. --- compiler-rt/lib/xray/xray_fdr_logging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/xray/xray_fdr_logging.cpp b/compiler-rt/lib/xray/xray_fdr_logging.cpp index 7def3565d56ab..977a0b9b87f4e 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::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.