motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 58e558822a2980bcaf29ce2a07474093702cabc6 (tree)
parent 5e3cadf871ab800d90c85f39cc28b922539d4dbf
Author: kcbanner <kcbanner@gmail.com>
Date:   Sun,  8 Jan 2023 23:51:55 -0500

windows: unexpectedStatus/unexpectedError start the stack trace at the caller

Diffstat:
Mlib/std/os/windows.zig | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig @@ -2077,7 +2077,7 @@ pub fn unexpectedError(err: Win32Error) std.os.UnexpectedError { ); _ = std.unicode.utf16leToUtf8(&buf_utf8, buf_wstr[0..len]) catch unreachable; std.debug.print("error.Unexpected: GetLastError({}): {s}\n", .{ @enumToInt(err), buf_utf8[0..len] }); - std.debug.dumpCurrentStackTrace(null); + std.debug.dumpCurrentStackTrace(@returnAddress()); } return error.Unexpected; } @@ -2091,7 +2091,7 @@ pub fn unexpectedWSAError(err: ws2_32.WinsockError) std.os.UnexpectedError { pub fn unexpectedStatus(status: NTSTATUS) std.os.UnexpectedError { if (std.os.unexpected_error_tracing) { std.debug.print("error.Unexpected NTSTATUS=0x{x}\n", .{@enumToInt(status)}); - std.debug.dumpCurrentStackTrace(null); + std.debug.dumpCurrentStackTrace(@returnAddress()); } return error.Unexpected; }