Skip to content

Commit 6702284

Browse files
committed
link: do not try to create LlvmObject if module is null
repeat e7c6dfd for other backends.
1 parent bece97e commit 6702284

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/link/Coff.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*Coff {
271271
.data_directories = comptime mem.zeroes([coff.IMAGE_NUMBEROF_DIRECTORY_ENTRIES]coff.ImageDataDirectory),
272272
};
273273

274-
if (options.use_llvm) {
274+
if (options.use_llvm and options.module != null) {
275275
self.llvm_object = try LlvmObject.create(gpa, options);
276276
}
277277
return self;

src/link/Wasm.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*Wasm {
528528
.name = undefined,
529529
};
530530

531-
if (options.use_llvm) {
531+
if (options.use_llvm and options.module != null) {
532532
wasm.llvm_object = try LlvmObject.create(gpa, options);
533533
}
534534
return wasm;

0 commit comments

Comments
 (0)