diff options
| author | Rocknest <35231115+Rocknest@users.noreply.github.com> | 2020-01-29 21:09:00 +0200 |
|---|---|---|
| committer | Rocknest <35231115+Rocknest@users.noreply.github.com> | 2020-01-29 21:09:00 +0200 |
| commit | b7cd60a354731d61ee3a3184fd4be610382ca1d6 (patch) | |
| tree | 31064a32d106da498293fef9427ff8d4e2e48c38 /lib/std | |
| parent | 3500b41bfed159b54b951b7cee5ff404ae5fbbda (diff) | |
| download | zig-b7cd60a354731d61ee3a3184fd4be610382ca1d6.tar.gz zig-b7cd60a354731d61ee3a3184fd4be610382ca1d6.zip | |
Changing stuff and seeing what happens
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/debug.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 561993fb99..acc3f36412 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -129,7 +129,7 @@ pub fn dumpStackTraceFromBase(bp: usize, ip: usize) void { return; }; const tty_config = detectTTYConfig(); - printSourceAtAddress(debug_info, stderr, ip, tty_config) catch return; + printSourceAtAddress(debug_info, stderr, if (builtin.os == .windows) (ip + 1) else ip, tty_config) catch return; const first_return_address = @intToPtr(*const usize, bp + @sizeOf(usize)).*; printSourceAtAddress(debug_info, stderr, first_return_address - 1, tty_config) catch return; var it = StackIterator{ @@ -325,6 +325,7 @@ pub const StackIterator = struct { } const return_address = @intToPtr(*const usize, self.fp - fp_adjust_factor + @sizeOf(usize)).*; + if (return_address == 0) return null; return return_address; } }; |
