authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-06-08 23:04:00+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-06-12 17:51:29+01:00
log89a6c732e5dcf82fb0cdd18f268b8d0c908b12e8
tree4ebc8e98dfdd82c5198d80068d2d4dbe6913e056
parente28b699cbfa4390366d68784b896ee2662af411d
signaturelock-open Commit is signed but in an unrecognized format.

Zcu: fix `deleteExport` crash with LLVM backend


1 files changed, 7 insertions(+), 3 deletions(-)

src/Zcu/PerThread.zig+7-3
......@@ -3098,7 +3098,9 @@ pub fn processExports(pt: Zcu.PerThread) !void {
30983098 // This export might already have been sent to the linker on a previous update, in which case we need to delete it.
30993099 // The linker export API should be modified to eliminate this call. #23616
31003100 if (zcu.comp.bin_file) |lf| {
3101 lf.deleteExport(exp.exported, exp.opts.name);
3101 if (zcu.llvm_object == null) {
3102 lf.deleteExport(exp.exported, exp.opts.name);
3103 }
31023104 }
31033105 continue;
31043106 }
......@@ -3122,8 +3124,10 @@ pub fn processExports(pt: Zcu.PerThread) !void {
31223124 // This export might already have been sent to the linker on a previous update, in which case we need to delete it.
31233125 // The linker export API should be modified to eliminate this loop. #23616
31243126 if (zcu.comp.bin_file) |lf| {
3125 for (exports) |exp| {
3126 lf.deleteExport(exp.exported, exp.opts.name);
3127 if (zcu.llvm_object == null) {
3128 for (exports) |exp| {
3129 lf.deleteExport(exp.exported, exp.opts.name);
3130 }
31273131 }
31283132 }
31293133 continue;