From 278c7a2bc398ac71afc9b9b392e863a758abb5fd Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 12 Jun 2019 13:42:21 -0400 Subject: fix `@bitCast` regressions --- src/ir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 9a5b79146c..acf9e0ca00 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -4951,6 +4951,7 @@ static IrInstruction *ir_gen_builtin_fn_call(IrBuilder *irb, Scope *scope, AstNo ResultLocBitCast *result_loc_bit_cast = allocate(1); result_loc_bit_cast->base.id = ResultLocIdBitCast; result_loc_bit_cast->base.source_instruction = dest_type; + ir_ref_instruction(dest_type, irb->current_basic_block); result_loc_bit_cast->parent = result_loc; AstNode *arg1_node = node->data.fn_call_expr.params.at(1); @@ -24219,7 +24220,7 @@ static IrInstruction *ir_analyze_instruction_end_expr(IrAnalyze *ira, IrInstruct static IrInstruction *ir_analyze_instruction_bit_cast_src(IrAnalyze *ira, IrInstructionBitCastSrc *instruction) { IrInstruction *operand = instruction->operand->child; - if (type_is_invalid(operand->value.type) || instr_is_comptime(operand) || + if (type_is_invalid(operand->value.type) || instruction->result_loc_bit_cast->parent->gen_instruction == nullptr) { return operand; -- cgit v1.2.3