authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-07 03:38:41+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-10-07 03:38:41+02:00
logcc79cc9f55acd68d03ff7f7abf39508f3e954f3a
treeb1f1f41bda2a4941713478909d80680f8e76fed7
parentaa8f39e2711dc2e9659e1c4d7388467c45271836
parentf18c71ba73a48b5bf6b5596166114c514a25e026
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #21615 from linusg/panic-uefi

std.debug: Fix defaultPanic() uefi build

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/debug.zig+2-2
......@@ -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_data.len, exit_data.ptr);
511511 }
512512 @trap();
513513 },