Skip to content

Commit 0f59b8d

Browse files
authored
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 (#94171) bulk-updated alignment usage to C++23 spec, but missed this occurrence.
1 parent c962234 commit 0f59b8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/xray/xray_fdr_logging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static_assert(std::is_trivially_destructible<ThreadLocalData>::value,
7373
static pthread_key_t Key;
7474

7575
// Global BufferQueue.
76-
static std::byte BufferQueueStorage[sizeof(BufferQueue)];
76+
alignas(BufferQueue) static std::byte BufferQueueStorage[sizeof(BufferQueue)];
7777
static BufferQueue *BQ = nullptr;
7878

7979
// Global thresholds for function durations.

0 commit comments

Comments
 (0)