Skip to content

Commit 42c37d9

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

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
@@ -527,7 +527,7 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*Wasm {
527527
.name = undefined,
528528
};
529529

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

0 commit comments

Comments
 (0)