| ... | @@ -2058,7 +2058,7 @@ static IrInstruction *ir_gen_if_var_expr(IrBuilder *irb, AstNode *node) { | ... | @@ -2058,7 +2058,7 @@ static IrInstruction *ir_gen_if_var_expr(IrBuilder *irb, AstNode *node) { |
| 2058 | return ir_build_phi(irb, node, 2, incoming_blocks, incoming_values); | 2058 | return ir_build_phi(irb, node, 2, incoming_blocks, incoming_values); |
| 2059 | } | 2059 | } |
| 2060 | | 2060 | |
| 2061 | static IrInstruction *ir_gen_node_extra(IrBuilder *irb, AstNode *node, BlockContext *block_context, | 2061 | static IrInstruction *ir_gen_node_raw(IrBuilder *irb, AstNode *node, BlockContext *block_context, |
| 2062 | LValPurpose lval) | 2062 | LValPurpose lval) |
| 2063 | { | 2063 | { |
| 2064 | assert(block_context); | 2064 | assert(block_context); |
| ... | @@ -2140,6 +2140,14 @@ static IrInstruction *ir_gen_node_extra(IrBuilder *irb, AstNode *node, BlockCont | ... | @@ -2140,6 +2140,14 @@ static IrInstruction *ir_gen_node_extra(IrBuilder *irb, AstNode *node, BlockCont |
| 2140 | zig_unreachable(); | 2140 | zig_unreachable(); |
| 2141 | } | 2141 | } |
| 2142 | | 2142 | |
| | 2143 | static IrInstruction *ir_gen_node_extra(IrBuilder *irb, AstNode *node, BlockContext *block_context, |
| | 2144 | LValPurpose lval) |
| | 2145 | { |
| | 2146 | IrInstruction *result = ir_gen_node_raw(irb, node, block_context, lval); |
| | 2147 | irb->exec->invalid = irb->exec->invalid || (result == irb->codegen->invalid_instruction); |
| | 2148 | return result; |
| | 2149 | } |
| | 2150 | |
| 2143 | static IrInstruction *ir_gen_node(IrBuilder *irb, AstNode *node, BlockContext *scope) { | 2151 | static IrInstruction *ir_gen_node(IrBuilder *irb, AstNode *node, BlockContext *scope) { |
| 2144 | return ir_gen_node_extra(irb, node, scope, LValPurposeNone); | 2152 | return ir_gen_node_extra(irb, node, scope, LValPurposeNone); |
| 2145 | } | 2153 | } |
| ... | @@ -4881,6 +4889,8 @@ static TypeTableEntry *ir_analyze_instruction(IrAnalyze *ira, IrInstruction *ins | ... | @@ -4881,6 +4889,8 @@ static TypeTableEntry *ir_analyze_instruction(IrAnalyze *ira, IrInstruction *ins |
| 4881 | TypeTableEntry *ir_analyze(CodeGen *codegen, IrExecutable *old_exec, IrExecutable *new_exec, | 4889 | TypeTableEntry *ir_analyze(CodeGen *codegen, IrExecutable *old_exec, IrExecutable *new_exec, |
| 4882 | TypeTableEntry *expected_type, AstNode *expected_type_source_node) | 4890 | TypeTableEntry *expected_type, AstNode *expected_type_source_node) |
| 4883 | { | 4891 | { |
| | 4892 | assert(!old_exec->invalid); |
| | 4893 | |
| 4884 | IrAnalyze ir_analyze_data = {}; | 4894 | IrAnalyze ir_analyze_data = {}; |
| 4885 | IrAnalyze *ira = &ir_analyze_data; | 4895 | IrAnalyze *ira = &ir_analyze_data; |
| 4886 | ira->codegen = codegen; | 4896 | ira->codegen = codegen; |