| ... | @@ -6329,17 +6329,20 @@ static bool ir_gen_switch_prong_expr(IrBuilder *irb, Scope *scope, AstNode *swit | ... | @@ -6329,17 +6329,20 @@ static bool ir_gen_switch_prong_expr(IrBuilder *irb, Scope *scope, AstNode *swit |
| 6329 | ZigVar *var = ir_create_var(irb, var_symbol_node, scope, | 6329 | ZigVar *var = ir_create_var(irb, var_symbol_node, scope, |
| 6330 | var_name, is_const, is_const, is_shadowable, var_is_comptime); | 6330 | var_name, is_const, is_const, is_shadowable, var_is_comptime); |
| 6331 | child_scope = var->child_scope; | 6331 | child_scope = var->child_scope; |
| 6332 | IrInstruction *var_ptr_value; | 6332 | IrInstruction *var_value; |
| 6333 | if (prong_value != nullptr) { | 6333 | if (out_switch_else_var != nullptr) { |
| 6334 | var_ptr_value = ir_build_switch_var(irb, scope, var_symbol_node, target_value_ptr, prong_value); | | |
| 6335 | } else { | | |
| 6336 | IrInstructionSwitchElseVar *switch_else_var = ir_build_switch_else_var(irb, scope, var_symbol_node, | 6334 | IrInstructionSwitchElseVar *switch_else_var = ir_build_switch_else_var(irb, scope, var_symbol_node, |
| 6337 | target_value_ptr); | 6335 | target_value_ptr); |
| 6338 | *out_switch_else_var = switch_else_var; | 6336 | *out_switch_else_var = switch_else_var; |
| 6339 | var_ptr_value = &switch_else_var->base; | 6337 | IrInstruction *var_ptr_value = &switch_else_var->base; |
| | 6338 | var_value = var_is_ptr ? var_ptr_value : ir_build_load_ptr(irb, scope, var_symbol_node, var_ptr_value); |
| | 6339 | } else if (prong_value != nullptr) { |
| | 6340 | IrInstruction *var_ptr_value = ir_build_switch_var(irb, scope, var_symbol_node, target_value_ptr, prong_value); |
| | 6341 | var_value = var_is_ptr ? var_ptr_value : ir_build_load_ptr(irb, scope, var_symbol_node, var_ptr_value); |
| | 6342 | } else { |
| | 6343 | var_value = var_is_ptr ? target_value_ptr : ir_build_load_ptr(irb, scope, var_symbol_node, |
| | 6344 | target_value_ptr); |
| 6340 | } | 6345 | } |
| 6341 | IrInstruction *var_value = var_is_ptr ? | | |
| 6342 | var_ptr_value : ir_build_load_ptr(irb, scope, var_symbol_node, var_ptr_value); | | |
| 6343 | IrInstruction *var_type = nullptr; // infer the type | 6346 | IrInstruction *var_type = nullptr; // infer the type |
| 6344 | ir_build_var_decl_src(irb, scope, var_symbol_node, var, var_type, nullptr, var_value); | 6347 | ir_build_var_decl_src(irb, scope, var_symbol_node, var, var_type, nullptr, var_value); |
| 6345 | } else { | 6348 | } else { |