From f90a19ba4c91d0032d78e51e244c0a23f2afd858 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Wed, 12 May 2021 06:34:33 -0600 Subject: [PATCH] LibJS: Make sure all allocators are 8-byte aligned Absolutely massive allocations > 1024 bytes would go into the size class which was 3172 bytes. 3172 happens to not be 8 byte aligned, and so made UBSAN very sad on x86_64. Change the largest allocator to be 3072 bytes, which is in fact a multiple of 8 :^) --- Userland/Libraries/LibJS/Heap/Heap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Heap/Heap.cpp b/Userland/Libraries/LibJS/Heap/Heap.cpp index 6ff0c55d5b..992c0fa25f 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.cpp +++ b/Userland/Libraries/LibJS/Heap/Heap.cpp @@ -30,7 +30,7 @@ Heap::Heap(VM& vm) m_allocators.append(make(256)); m_allocators.append(make(512)); m_allocators.append(make(1024)); - m_allocators.append(make(3172)); + m_allocators.append(make(3072)); } Heap::~Heap()