zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 8d76c02f9a7ca664ee669e1f9c1a70b841eb2774 (tree)
parent 37cd21eb5f23d2bb26e36ca3de76f0a71e16230c
Author: Nameless <truemedian@gmail.com>
Date:   Thu, 19 Sep 2024 18:03:33 -0500

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.

Diffstat:
Mlib/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 @@ -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; }