authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2022-11-25 14:58:14+01:00
committergravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2023-04-09 01:51:47+02:00
logc6fbe0d5d89a7b2665a0afa7fad23027fd0b87ca
treedf5f3c52356cd60ad77f6080b774d3ece66b6b79
parent6dc1fafe9882bdfb063c9bc02149c4a97fcaa2b5
signaturelock-open Commit is signed but in an unrecognized format.

dont destroy old bin file on link openpath failure

This was causing some crashes.

1 files changed, 2 insertions(+), 1 deletions(-)

src/Compilation.zig+2-1
...@@ -1948,8 +1948,9 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void...@@ -1948,8 +1948,9 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void
1948 .sub_path = std.fs.path.basename(sub_path),1948 .sub_path = std.fs.path.basename(sub_path),
1949 };1949 };
1950 }1950 }
1951 comp.bin_file.destroy();1951 var old_bin_file = comp.bin_file;
1952 comp.bin_file = try link.File.openPath(comp.gpa, options);1952 comp.bin_file = try link.File.openPath(comp.gpa, options);
1953 old_bin_file.destroy();
1953 }1954 }
19541955
1955 // For compiling C objects, we rely on the cache hash system to avoid duplicating work.1956 // For compiling C objects, we rely on the cache hash system to avoid duplicating work.