Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uefi: erroneous alignment check in pool_allocator #21456

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

truemedian
Copy link
Contributor

Fixes #21446

Both UefiPoolAllocator and UefiRawPoolAllocator were passing the value of log2_ptr_align directly to
mem.alignAllocLen which expects a alignment value.

I have removed these calls entirely because the value was thrown away regardless, and the alignment given is always valid (not that either resize could do anything about it).

Fixes ziglang#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.
Copy link
Member

@alexrp alexrp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable judging by other Allocator implementations.

@andrewrk andrewrk merged commit 8d76c02 into ziglang:master Sep 24, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UEFI.pool_allocator.resize() Unreachable Code when length and capacity match on an ArrayList
3 participants