From ecf9bb207c8d4430825aa867d3d3eb7f9422e675 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 24 Oct 2026 20:09:10 -0700 Subject: [PATCH] [Allocator] Cap MinAlign at alignof(max_align_t) (#235373) alignof(std::max_align_t) is 4 on NetBSD/i386, whose defines max_align_t as a union of void *, long double, and long long. Fix #230782 (cherry picked from commit 0b6b6ed806536c1b170101061ff3eeed91c8f061) --- llvm/include/llvm/Support/Allocator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h index bb0ca118e201..b5f40ef72cd7 100644 --- a/llvm/include/llvm/Support/Allocator.h +++ b/llvm/include/llvm/Support/Allocator.h @@ -64,7 +64,7 @@ LLVM_ABI void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t TotalMemory); /// CurPtr when the requested alignment is no greater than MinAlign. template + size_t MinAlign = std::min(8, alignof(std::max_align_t))> class BumpPtrAllocatorImpl : public AllocatorBase>,