Skip to content

Commit 95e5dbf

Browse files
committed
Zcu: fix deleteExport crash with LLVM backend
1 parent a32b324 commit 95e5dbf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Zcu/PerThread.zig

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

0 commit comments

Comments
 (0)