From 8d76c02f9a7ca664ee669e1f9c1a70b841eb2774 Mon Sep 17 00:00:00 2001 From: Nameless Date: Thu, 19 Sep 2024 18:03:33 -0500 Subject: [PATCH] uefi: erroneous alignment check in pool_allocator Fixes #21446 Both UefiPoolAllocator and UefiRawPoolAllocator were passing the value of `log2_ptr_align` directly to `mem.alignAllocLen` which expects a alignment value. Both of these calls to `mem.alignAllocLen` are pointless and the result of the alignment both always true, and was thrown away anyway. I have removed these calls entirely. --- lib/std/os/uefi/pool_allocator.zig | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/std/os/uefi/pool_allocator.zig b/lib/std/os/uefi/pool_allocator.zig index aa9798c6e5..f7962f22aa 100644 --- a/lib/std/os/uefi/pool_allocator.zig +++ b/lib/std/os/uefi/pool_allocator.zig @@ -48,11 +48,9 @@ const UefiPoolAllocator = struct { ret_addr: usize, ) bool { _ = ret_addr; + _ = log2_old_ptr_align; if (new_len > buf.len) return false; - - _ = mem.alignAllocLen(buf.len, new_len, log2_old_ptr_align); - return true; } @@ -121,9 +119,6 @@ fn uefi_resize( std.debug.assert(log2_old_ptr_align <= 3); if (new_len > buf.len) return false; - - _ = mem.alignAllocLen(buf.len, new_len, 8); - return true; }