diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-11-21 17:07:29 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-11-21 17:07:29 -0500 |
| commit | cd37c1a377483154e82dce47b10ab0c54264f4e9 (patch) | |
| tree | 67d908d53227f1900637a9e267dec1771c84e2f4 /lib/std/debug.zig | |
| parent | 874b34a30f588294210fe91d08e29fc6baa1a0a4 (diff) | |
| download | zig-cd37c1a377483154e82dce47b10ab0c54264f4e9.tar.gz zig-cd37c1a377483154e82dce47b10ab0c54264f4e9.zip | |
add std.fs.Dir.openRead
This is progress towards file system APIs that encourage avoiding
Time Of Check, Time Of Use bugs.
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 3cf4306ea5..7698443ce8 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -1711,7 +1711,12 @@ fn getLineNumberInfoMacOs(di: *DebugInfo, symbol: MachoSymbol, target_address: u const ofile_path = mem.toSliceConst(u8, di.strings.ptr + ofile.n_strx); gop.kv.value = MachOFile{ - .bytes = try std.io.readFileAllocAligned(di.ofiles.allocator, ofile_path, @alignOf(macho.mach_header_64)), + .bytes = try std.fs.Dir.cwd().readFileAllocAligned( + di.ofiles.allocator, + ofile_path, + maxInt(usize), + @alignOf(macho.mach_header_64), + ), .sect_debug_info = null, .sect_debug_line = null, }; |
