aboutsummaryrefslogtreecommitdiff
path: root/std/debug/index.zig
diff options
context:
space:
mode:
authorSahnvour <sahnvour@gmail.com>2018-11-28 00:24:06 +0100
committerAndrew Kelley <andrew@ziglang.org>2018-11-27 20:34:55 -0500
commit1fb15be05f1037aad53d2db32d13123363365d10 (patch)
tree2900aae474be543e68fd1c85215d045b0dff448a /std/debug/index.zig
parent3c4965a6162e50064d22bc1900584e74e2ef15ea (diff)
downloadzig-1fb15be05f1037aad53d2db32d13123363365d10.tar.gz
zig-1fb15be05f1037aad53d2db32d13123363365d10.zip
stack traces: fix for windows
Diffstat (limited to 'std/debug/index.zig')
-rw-r--r--std/debug/index.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/std/debug/index.zig b/std/debug/index.zig
index b077bdb3b0..134f0a479f 100644
--- a/std/debug/index.zig
+++ b/std/debug/index.zig
@@ -282,8 +282,9 @@ fn printSourceAtAddressWindows(di: *DebugInfo, out_stream: var, relocated_addres
var coff_section: *coff.Section = undefined;
const mod_index = for (di.sect_contribs) |sect_contrib| {
- if (sect_contrib.Section >= di.coff.sections.len) continue;
- coff_section = &di.coff.sections.toSlice()[sect_contrib.Section];
+ if (sect_contrib.Section > di.coff.sections.len) continue;
+ // Remember that SectionContribEntry.Section is 1-based.
+ coff_section = &di.coff.sections.toSlice()[sect_contrib.Section-1];
const vaddr_start = coff_section.header.virtual_address + sect_contrib.Offset;
const vaddr_end = vaddr_start + sect_contrib.Size;