stage2: fix bitcast to optional ptr in llvm backend; omit safety check for intToPtr on optional ptr

This commit is contained in:
Veikka Tuominen
2022-02-27 12:15:49 +02:00
parent 950d840be6
commit 1bbca4f935
3 changed files with 11 additions and 5 deletions

View File

@@ -3892,7 +3892,7 @@ pub const FuncGen = struct {
return self.builder.buildBitCast(operand, llvm_dest_ty.pointerType(0), "");
}
if (operand_ty.zigTypeTag() == .Int and inst_ty.zigTypeTag() == .Pointer) {
if (operand_ty.zigTypeTag() == .Int and inst_ty.isPtrAtRuntime()) {
return self.builder.buildIntToPtr(operand, llvm_dest_ty, "");
}