Commit 7336b750bd

LemonBoy <thatlemon@gmail.com>
2020-01-27 13:12:01
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.
1 parent f8e015c
Changed files (1)
lib
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);
     }
 }