diff options
| author | Robin Voetter <robin@voetter.nl> | 2022-11-25 14:58:14 +0100 |
|---|---|---|
| committer | Robin Voetter <robin@voetter.nl> | 2023-04-09 01:51:47 +0200 |
| commit | c6fbe0d5d89a7b2665a0afa7fad23027fd0b87ca (patch) | |
| tree | df5f3c52356cd60ad77f6080b774d3ece66b6b79 /src/Compilation.zig | |
| parent | 6dc1fafe9882bdfb063c9bc02149c4a97fcaa2b5 (diff) | |
| download | zig-c6fbe0d5d89a7b2665a0afa7fad23027fd0b87ca.tar.gz zig-c6fbe0d5d89a7b2665a0afa7fad23027fd0b87ca.zip | |
dont destroy old bin file on link openpath failure
This was causing some crashes.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index f6f4851e5e..caa572e29d 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1948,8 +1948,9 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void .sub_path = std.fs.path.basename(sub_path), }; } - comp.bin_file.destroy(); + var old_bin_file = comp.bin_file; comp.bin_file = try link.File.openPath(comp.gpa, options); + old_bin_file.destroy(); } // For compiling C objects, we rely on the cache hash system to avoid duplicating work. |
