From 7336b750bd5e3c271a654e6d44d572cf0427a0b1 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Mon, 27 Jan 2020 13:12:01 +0100 Subject: [PATCH] Fix stack-trace address calculation on Windows Let's always subtract 1 from the return address so that we're sure to be inside the callee. Fixes some edge case where the stack trace skipped the first entry. --- lib/std/debug.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 442b5db210..97c20e5104 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -360,7 +360,7 @@ pub fn writeCurrentStackTraceWindows( return; } else 0; for (addrs[start_i..]) |addr| { - try printSourceAtAddress(debug_info, out_stream, addr, tty_config); + try printSourceAtAddress(debug_info, out_stream, addr - 1, tty_config); } }