authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-01-27 13:12:01+01:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-01-27 13:12:01+01:00
log7336b750bd5e3c271a654e6d44d572cf0427a0b1
tree9f9432d563b33115ca4c2dc12ca59cfcb81b3fe1
parentf8e015c85f2eaf4d35523d362a7be2b9614a162b

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 files changed, 1 insertions(+), 1 deletions(-)

lib/std/debug.zig+1-1
...@@ -360,7 +360,7 @@ pub fn writeCurrentStackTraceWindows(...@@ -360,7 +360,7 @@ pub fn writeCurrentStackTraceWindows(
360 return;360 return;
361 } else 0;361 } else 0;
362 for (addrs[start_i..]) |addr| {362 for (addrs[start_i..]) |addr| {
363 try printSourceAtAddress(debug_info, out_stream, addr, tty_config);363 try printSourceAtAddress(debug_info, out_stream, addr - 1, tty_config);
364 }364 }
365}365}
366366