Skip to content

Commit 69cf40d

Browse files
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
1 parent 6e55898 commit 69cf40d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/os/uefi/protocol/file.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ pub const File = extern struct {
214214
pub fn getInfo(
215215
self: *const File,
216216
comptime info: std.meta.Tag(Info),
217-
buffer: []u8,
217+
buffer: []align(@alignOf(@FieldType(Info, @tagName(info)))) u8,
218218
) GetInfoError!*@FieldType(Info, @tagName(info)) {
219219
const InfoType = @FieldType(Info, @tagName(info));
220220

0 commit comments

Comments
 (0)