diff options
| author | LemonBoy <thatlemon@gmail.com> | 2019-11-17 16:55:38 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-11-17 22:25:14 +0000 |
| commit | 924dd674e2e584bbef5e7650f481e49829c8fe28 (patch) | |
| tree | fec5f00575cf95b8584e498683de9234fd4c9b9a /src/ir.cpp | |
| parent | 6cddf9d7238a58b88064c3f3ce6e3948143598d8 (diff) | |
| download | zig-924dd674e2e584bbef5e7650f481e49829c8fe28.tar.gz zig-924dd674e2e584bbef5e7650f481e49829c8fe28.zip | |
Catch invalid type from peer resolution
Fixes #3703
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 99af2e7861..d50229925c 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -17695,6 +17695,8 @@ static IrInstruction *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionPh peer_parent->resolved_type = ir_resolve_peer_types(ira, peer_parent->base.source_instruction->source_node, expected_type, instructions, peer_parent->peers.length); + if (type_is_invalid(peer_parent->resolved_type)) + return ira->codegen->invalid_instruction; // the logic below assumes there are no instructions in the new current basic block yet ir_assert(ira->new_irb.current_basic_block->instruction_list.length == 0, &phi_instruction->base); |
