mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
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.
This commit is contained in:
parent
37cd21eb5f
commit
8d76c02f9a
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user