fix not initializing some ZigTarget fields

This commit is contained in:
Andrew Kelley 2020-02-21 01:54:00 -05:00
parent 2de7d0b10c
commit 7b8b4d200c
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -952,11 +952,19 @@ const Stage2Target = extern struct {
},
.Cross => target.getCpu(),
};
self.arch = @enumToInt(target.getArch()) + 1; // skip over ZigLLVM_UnknownArch
self.sub_arch = 0;
self.vendor = 0;
self.os = @enumToInt(target.getOs());
self.abi = @enumToInt(target.getAbi());
self.* = .{
.arch = @enumToInt(target.getArch()) + 1, // skip over ZigLLVM_UnknownArch
.sub_arch = 0,
.vendor = 0,
.os = @enumToInt(target.getOs()),
.abi = @enumToInt(target.getAbi()),
.llvm_cpu_name = null,
.llvm_cpu_features = null,
.builtin_str = null,
.cache_hash = null,
.is_native = target == .Native,
.glibc_version = null,
};
try initStage1TargetCpuFeatures(self, cpu);
}
};