Skip to content

Commit 40a3c81

Browse files
committed
std.debug: Fix defaultPanic() uefi build
lib/std/debug.zig:491:38: error: slice of non-array type 'u16' utf16_buffer[len_minus_3][0..3].* = .{ '\r', '\n', 0 }; ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ lib/std/debug.zig:510:70: error: expected type '?*const anyopaque', found '[]u16' _ = bs.exit(uefi.handle, .Aborted, exit_msg.len + 1, exit_data); ^~~~~~~~~ Regressed in ziglang#21520.
1 parent 148b5b4 commit 40a3c81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/std/debug.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ pub fn defaultPanic(
488488

489489
var utf16_buffer: [1000]u16 = undefined;
490490
const len_minus_3 = std.unicode.utf8ToUtf16Le(&utf16_buffer, msg) catch 0;
491-
utf16_buffer[len_minus_3][0..3].* = .{ '\r', '\n', 0 };
491+
utf16_buffer[len_minus_3..][0..3].* = .{ '\r', '\n', 0 };
492492
const len = len_minus_3 + 3;
493493
const exit_msg = utf16_buffer[0 .. len - 1 :0];
494494

@@ -507,7 +507,7 @@ pub fn defaultPanic(
507507
// ExitData buffer must be allocated using boot_services.allocatePool (spec: page 220)
508508
const exit_data: []u16 = uefi.raw_pool_allocator.alloc(u16, exit_msg.len + 1) catch @trap();
509509
@memcpy(exit_data, exit_msg[0..exit_data.len]); // Includes null terminator.
510-
_ = bs.exit(uefi.handle, .Aborted, exit_msg.len + 1, exit_data);
510+
_ = bs.exit(uefi.handle, .Aborted, exit_msg.len + 1, @ptrCast(exit_data));
511511
}
512512
@trap();
513513
},

0 commit comments

Comments
 (0)