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 {...@@ -3098,7 +3098,9 @@ pub fn processExports(pt: Zcu.PerThread) !void {
3098 // This export might already have been sent to the linker on a previous update, in which case we need to delete it.3098 // This export might already have been sent to the linker on a previous update, in which case we need to delete it.
3099 // The linker export API should be modified to eliminate this call. #236163099 // The linker export API should be modified to eliminate this call. #23616
3100 if (zcu.comp.bin_file) |lf| {3100 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 }
3102 }3104 }
3103 continue;3105 continue;
3104 }3106 }
...@@ -3122,8 +3124,10 @@ pub fn processExports(pt: Zcu.PerThread) !void {...@@ -3122,8 +3124,10 @@ pub fn processExports(pt: Zcu.PerThread) !void {
3122 // This export might already have been sent to the linker on a previous update, in which case we need to delete it.3124 // This export might already have been sent to the linker on a previous update, in which case we need to delete it.
3123 // The linker export API should be modified to eliminate this loop. #236163125 // The linker export API should be modified to eliminate this loop. #23616
3124 if (zcu.comp.bin_file) |lf| {3126 if (zcu.comp.bin_file) |lf| {
3125 for (exports) |exp| {3127 if (zcu.llvm_object == null) {
3126 lf.deleteExport(exp.exported, exp.opts.name);3128 for (exports) |exp| {
3129 lf.deleteExport(exp.exported, exp.opts.name);
3130 }
3127 }3131 }
3128 }3132 }
3129 continue;3133 continue;