From a2acc2787242fdee189ec4197c0dd847b8245139 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 7 Nov 2019 18:13:17 -0500 Subject: behavior tests passing --- src/ir.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index f7bfba6a99..148be3b507 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -17542,6 +17542,10 @@ static IrInstruction *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionPh if (peer_parent != nullptr && ir_result_has_type(peer_parent->parent)) { if (peer_parent->parent->id == ResultLocIdReturn) { resolved_type = ira->explicit_return_type; + } else if (peer_parent->parent->id == ResultLocIdCast) { + resolved_type = ir_resolve_type(ira, peer_parent->parent->source_instruction->child); + if (type_is_invalid(resolved_type)) + return ira->codegen->invalid_instruction; } else { ZigType *resolved_loc_ptr_type = peer_parent->parent->resolved_loc->value.type; ir_assert(resolved_loc_ptr_type->id == ZigTypeIdPointer, &phi_instruction->base); -- cgit v1.2.3