authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-18 14:44:25-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-18 14:44:25-04:00
logf90d17cc4db955ad6a3b866e641bf3bc0e7395f4
treecee34514ed23d9a5918df12a000003a5aa844655
parent077f9df15bffad714399762a5b0afe1bb8996ffb
signaturelock-open Commit is signed but in an unrecognized format.

fix bitcast


1 files changed, 7 insertions(+), 2 deletions(-)

src/ir.cpp+7-2
...@@ -23195,14 +23195,19 @@ static IrInstruction *ir_analyze_ptr_cast(IrAnalyze *ira, IrInstruction *source_...@@ -23195,14 +23195,19 @@ static IrInstruction *ir_analyze_ptr_cast(IrAnalyze *ira, IrInstruction *source_
23195 }23195 }
23196 }23196 }
2319723197
23198 IrInstruction *result = ir_const(ira, source_instr, dest_type);23198 IrInstruction *result;
23199 if (ptr->value.data.x_ptr.mut == ConstPtrMutInfer) {
23200 result = ir_build_ptr_cast_gen(ira, source_instr, dest_type, ptr, safety_check_on);
23201 } else {
23202 result = ir_const(ira, source_instr, dest_type);
23203 }
23199 copy_const_val(&result->value, val, true);23204 copy_const_val(&result->value, val, true);
23200 result->value.type = dest_type;23205 result->value.type = dest_type;
2320123206
23202 // Keep the bigger alignment, it can only help-23207 // Keep the bigger alignment, it can only help-
23203 // unless the target is zero bits.23208 // unless the target is zero bits.
23204 if (src_align_bytes > dest_align_bytes && type_has_bits(dest_type)) {23209 if (src_align_bytes > dest_align_bytes && type_has_bits(dest_type)) {
23205 result = ir_align_cast(ira, result, src_align_bytes, false);23210 result = ir_align_cast(ira, result, src_align_bytes, false);
23206 }23211 }
2320723212
23208 return result;23213 return result;