authorgravatar for 35231115+Rocknest@users.noreply.github.comRocknest <35231115+Rocknest@users.noreply.github.com> 2020-01-29 23:48:52+02:00
committergravatar for 35231115+Rocknest@users.noreply.github.comRocknest <35231115+Rocknest@users.noreply.github.com> 2020-01-29 23:48:52+02:00
logc0c9c601d492e9da3f391ec4d837f7ab02b559df
tree977ddd740668c529ca41bfc518f9700d31cfac20
parent4a4d6f2be911cae08db434f877a1be2340d262c8

Fix off-by-one error


1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/debug.zig+2-2
......@@ -129,7 +129,7 @@ pub fn dumpStackTraceFromBase(bp: usize, ip: usize) void {
129129 return;
130130 };
131131 const tty_config = detectTTYConfig();
132 printSourceAtAddress(debug_info, stderr, if (builtin.os == .windows) (ip + 1) else ip, tty_config) catch return;
132 printSourceAtAddress(debug_info, stderr, ip, tty_config) catch return;
133133 const first_return_address = @intToPtr(*const usize, bp + @sizeOf(usize)).*;
134134 printSourceAtAddress(debug_info, stderr, first_return_address - 1, tty_config) catch return;
135135 var it = StackIterator{
......@@ -471,7 +471,7 @@ fn printSourceAtAddressWindows(
471471 line_index += @sizeOf(pdb.LineNumberEntry);
472472
473473 const vaddr_start = frag_vaddr_start + line_num_entry.Offset;
474 if (relative_address <= vaddr_start) {
474 if (relative_address < vaddr_start) {
475475 break;
476476 }
477477 }