authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-03-22 22:47:28+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-22 19:19:41-04:00
log9d19d9008eb70d069b799dd65a68bb410a5dff8e
treeb0055d73538129dcf6b626920b75513b4db98d22
parent6a89751025abc074d31bbbab5b01a7e701f1abce

debug: Correct version check in debug_line parser

Version 3 is similar to version 2 plus more opcodes.

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

lib/std/dwarf.zig+1-2
......@@ -717,8 +717,7 @@ pub const DwarfInfo = struct {
717717 const next_offset = unit_length + (if (is_64) @as(usize, 12) else @as(usize, 4));
718718
719719 const version = try in.readInt(u16, di.endian);
720 // TODO support 3 and 5
721 if (version != 2 and version != 4) return error.InvalidDebugInfo;
720 if (version < 2 or version > 4) return error.InvalidDebugInfo;
722721
723722 const prologue_length = if (is_64) try in.readInt(u64, di.endian) else try in.readInt(u32, di.endian);
724723 const prog_start_offset = (try seekable.getPos()) + prologue_length;