diff options
| author | Rocknest <35231115+Rocknest@users.noreply.github.com> | 2020-01-30 10:00:28 +0200 |
|---|---|---|
| committer | Rocknest <35231115+Rocknest@users.noreply.github.com> | 2020-01-30 10:00:28 +0200 |
| commit | a5f18c2b2ae86126e0fd0cba67676ae68ba0f1df (patch) | |
| tree | 35c49202c9d3f6af29fddbf046e29f3e9c67bfd0 | |
| parent | 94f29ae11736bd5abb0383610b42cb7ea19f1f0c (diff) | |
| download | zig-a5f18c2b2ae86126e0fd0cba67676ae68ba0f1df.tar.gz zig-a5f18c2b2ae86126e0fd0cba67676ae68ba0f1df.zip | |
Fix one more edge case
| -rw-r--r-- | lib/std/debug.zig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 2dd1da50c3..9cd76cb30c 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -131,6 +131,7 @@ pub fn dumpStackTraceFromBase(bp: usize, ip: usize) void { const tty_config = detectTTYConfig(); printSourceAtAddress(debug_info, stderr, ip, tty_config) catch return; const first_return_address = @intToPtr(*const usize, bp + @sizeOf(usize)).*; + if (first_return_address == 0) return; // The whole call stack may be optimized out printSourceAtAddress(debug_info, stderr, first_return_address - 1, tty_config) catch return; var it = StackIterator{ .first_addr = null, |
