elf: do not try to create LlvmObject if module is null

This commit is contained in:
Jakub Konka
2023-09-25 17:05:39 +02:00
parent 8abfb3559a
commit e7c6dfde3d

View File

@@ -254,7 +254,7 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*Elf {
.default_sym_version = default_sym_version,
};
const use_llvm = options.use_llvm;
if (use_llvm) {
if (use_llvm and options.module != null) {
self.llvm_object = try LlvmObject.create(gpa, options);
}