Skip to content

Commit 58e5588

Browse files
committed
windows: unexpectedStatus/unexpectedError start the stack trace at the caller
1 parent 5e3cadf commit 58e5588

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/std/os/windows.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,7 @@ pub fn unexpectedError(err: Win32Error) std.os.UnexpectedError {
20772077
);
20782078
_ = std.unicode.utf16leToUtf8(&buf_utf8, buf_wstr[0..len]) catch unreachable;
20792079
std.debug.print("error.Unexpected: GetLastError({}): {s}\n", .{ @enumToInt(err), buf_utf8[0..len] });
2080-
std.debug.dumpCurrentStackTrace(null);
2080+
std.debug.dumpCurrentStackTrace(@returnAddress());
20812081
}
20822082
return error.Unexpected;
20832083
}
@@ -2091,7 +2091,7 @@ pub fn unexpectedWSAError(err: ws2_32.WinsockError) std.os.UnexpectedError {
20912091
pub fn unexpectedStatus(status: NTSTATUS) std.os.UnexpectedError {
20922092
if (std.os.unexpected_error_tracing) {
20932093
std.debug.print("error.Unexpected NTSTATUS=0x{x}\n", .{@enumToInt(status)});
2094-
std.debug.dumpCurrentStackTrace(null);
2094+
std.debug.dumpCurrentStackTrace(@returnAddress());
20952095
}
20962096
return error.Unexpected;
20972097
}

0 commit comments

Comments
 (0)