Commit 52e7934a21

mlugg <mlugg@mlugg.co.uk>
2023-06-12 23:17:41
std.dwarf: fix findCompileUnit when ranges offset is given by const
1 parent 1ec1498
Changed files (1)
lib
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);