diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-06-08 23:04:00 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-06-12 17:51:29 +0100 |
| commit | 89a6c732e5dcf82fb0cdd18f268b8d0c908b12e8 (patch) | |
| tree | 4ebc8e98dfdd82c5198d80068d2d4dbe6913e056 /src/Zcu/PerThread.zig | |
| parent | e28b699cbfa4390366d68784b896ee2662af411d (diff) | |
| download | zig-89a6c732e5dcf82fb0cdd18f268b8d0c908b12e8.tar.gz zig-89a6c732e5dcf82fb0cdd18f268b8d0c908b12e8.zip | |
Zcu: fix `deleteExport` crash with LLVM backend
Diffstat (limited to 'src/Zcu/PerThread.zig')
| -rw-r--r-- | src/Zcu/PerThread.zig | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index 8bc723f2e8..9b6a43b496 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -3098,7 +3098,9 @@ pub fn processExports(pt: Zcu.PerThread) !void { // This export might already have been sent to the linker on a previous update, in which case we need to delete it. // The linker export API should be modified to eliminate this call. #23616 if (zcu.comp.bin_file) |lf| { - lf.deleteExport(exp.exported, exp.opts.name); + if (zcu.llvm_object == null) { + lf.deleteExport(exp.exported, exp.opts.name); + } } continue; } @@ -3122,8 +3124,10 @@ pub fn processExports(pt: Zcu.PerThread) !void { // This export might already have been sent to the linker on a previous update, in which case we need to delete it. // The linker export API should be modified to eliminate this loop. #23616 if (zcu.comp.bin_file) |lf| { - for (exports) |exp| { - lf.deleteExport(exp.exported, exp.opts.name); + if (zcu.llvm_object == null) { + for (exports) |exp| { + lf.deleteExport(exp.exported, exp.opts.name); + } } } continue; |
