fix bitcast

This commit is contained in:
Andrew Kelley 2019-06-18 14:44:25 -04:00
parent 077f9df15b
commit f90d17cc4d
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -23195,7 +23195,12 @@ static IrInstruction *ir_analyze_ptr_cast(IrAnalyze *ira, IrInstruction *source_
} }
} }
IrInstruction *result = ir_const(ira, source_instr, dest_type); IrInstruction *result;
if (ptr->value.data.x_ptr.mut == ConstPtrMutInfer) {
result = ir_build_ptr_cast_gen(ira, source_instr, dest_type, ptr, safety_check_on);
} else {
result = ir_const(ira, source_instr, dest_type);
}
copy_const_val(&result->value, val, true); copy_const_val(&result->value, val, true);
result->value.type = dest_type; result->value.type = dest_type;