From 52e7934a21e29b5a39fa207ef29520f58e311bb0 Mon Sep 17 00:00:00 2001 From: mlugg Date: Mon, 12 Jun 2023 22:17:41 +0100 Subject: [PATCH] std.dwarf: fix findCompileUnit when ranges offset is given by const --- lib/std/dwarf.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/std/dwarf.zig b/lib/std/dwarf.zig index dbe1f6e8b6..4de08b25d7 100644 --- a/lib/std/dwarf.zig +++ b/lib/std/dwarf.zig @@ -936,6 +936,7 @@ pub const DwarfInfo = struct { const ranges_val = compile_unit.die.getAttr(AT.ranges) orelse continue; const ranges_offset = switch (ranges_val.*) { .SecOffset => |off| off, + .Const => |c| try c.asUnsignedLe(), .RangeListOffset => |idx| off: { if (compile_unit.is_64) { const offset_loc = @intCast(usize, compile_unit.rnglists_base + 8 * idx);