commit 69cf40da600224734d39c6f64fb2e0905e42d54a (tree)
parent 6e5589866193a6bd73c75b126adeecd71924b6f5
Author: AsmArtisan256 <asm.artisan256@gmail.com>
Date: Fri, 18 Jul 2025 20:07:05 +0100
std.os.uefi.protocol.file: fix getInfo() buffer alignment (#24496)
* std.os.uefi.protocol.file: use @alignCast in getInfo() method to fix #24480
* std.os.uefi.protocol.file: pass alignment responsabilities to caller by redefining the buffer type instead of blindly calling @alignCast
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/std/os/uefi/protocol/file.zig b/lib/std/os/uefi/protocol/file.zig
@@ -214,7 +214,7 @@ pub const File = extern struct {
pub fn getInfo(
self: *const File,
comptime info: std.meta.Tag(Info),
- buffer: []u8,
+ buffer: []align(@alignOf(@FieldType(Info, @tagName(info)))) u8,
) GetInfoError!*@FieldType(Info, @tagName(info)) {
const InfoType = @FieldType(Info, @tagName(info));