Skip to content

Commit fd067fb

Browse files
committed
add workaround for #5525
1 parent 6524a64 commit fd067fb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/std/debug.zig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,10 +1295,13 @@ pub const DebugInfo = struct {
12951295
const obj_di = try self.allocator.create(ModuleDebugInfo);
12961296
errdefer self.allocator.destroy(obj_di);
12971297

1298-
const elf_file = (if (ctx.name.len > 0)
1298+
// TODO https://github.com/ziglang/zig/issues/5525
1299+
const copy = if (ctx.name.len > 0)
12991300
fs.cwd().openFile(ctx.name, .{ .intended_io_mode = .blocking })
13001301
else
1301-
fs.openSelfExe(.{ .intended_io_mode = .blocking })) catch |err| switch (err) {
1302+
fs.openSelfExe(.{ .intended_io_mode = .blocking });
1303+
1304+
const elf_file = copy catch |err| switch (err) {
13021305
error.FileNotFound => return error.MissingDebugInfo,
13031306
else => return err,
13041307
};

0 commit comments

Comments
 (0)