| author | |
| committer | |
| log | 6734271eb0b8b7eafd098986b30a5bc34e180b72 |
| tree | cda1ce0885d8eff9aba9e955432fb8a51314f018 |
| parent | 0c091feb5ae52caf1ebf885c0de55b3159207001 |
While investigating hexops/mach#8 with @slimsag,
we found that zld is forming invalid file paths (absolute paths concatenated together),
which hits the unreachable `OBJECT_NAME_INVALID` case in `openDirAccessMaskW`:
https://github.com/ziglang/zig/blob/0c091feb5ae52caf1ebf885c0de55b3159207001/lib/std/fs.zig#L1522
This is caused by appending `dir` (which is guaranteed to be absolute) to `root`,
an obviously incorrect operation:
https://github.com/ziglang/zig/blob/0c091feb5ae52caf1ebf885c0de55b3159207001/src/link/MachO.zig#L494-L499
Fixes hexops/mach#8
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Signed-off-by: Andrew Gutekanst <andrew.gutekanst@gmail.com>1 files changed, 1 insertions(+), 1 deletions(-)
src/link/MachO.zig+1-1| ... | ... | @@ -491,7 +491,7 @@ fn resolveSearchDir( |
| 491 | 491 | ) !?[]const u8 { |
| 492 | 492 | var candidates = std.ArrayList([]const u8).init(arena); |
| 493 | 493 | |
| 494 | if (fs.path.isAbsolute(dir)) { | |
| 494 | if (!fs.path.isAbsolute(dir)) { | |
| 495 | 495 | if (syslibroot) |root| { |
| 496 | 496 | const full_path = try fs.path.join(arena, &[_][]const u8{ root, dir }); |
| 497 | 497 | try candidates.append(full_path); |