| ... | @@ -282,8 +282,9 @@ fn printSourceAtAddressWindows(di: *DebugInfo, out_stream: var, relocated_addres | ... | @@ -282,8 +282,9 @@ fn printSourceAtAddressWindows(di: *DebugInfo, out_stream: var, relocated_addres |
| 282 | | 282 | |
| 283 | var coff_section: *coff.Section = undefined; | 283 | var coff_section: *coff.Section = undefined; |
| 284 | const mod_index = for (di.sect_contribs) |sect_contrib| { | 284 | const mod_index = for (di.sect_contribs) |sect_contrib| { |
| 285 | if (sect_contrib.Section >= di.coff.sections.len) continue; | 285 | if (sect_contrib.Section > di.coff.sections.len) continue; |
| 286 | coff_section = &di.coff.sections.toSlice()[sect_contrib.Section]; | 286 | // Remember that SectionContribEntry.Section is 1-based. |
| | 287 | coff_section = &di.coff.sections.toSlice()[sect_contrib.Section-1]; |
| 287 | | 288 | |
| 288 | const vaddr_start = coff_section.header.virtual_address + sect_contrib.Offset; | 289 | const vaddr_start = coff_section.header.virtual_address + sect_contrib.Offset; |
| 289 | const vaddr_end = vaddr_start + sect_contrib.Size; | 290 | const vaddr_end = vaddr_start + sect_contrib.Size; |