| ... | @@ -8994,9 +8994,10 @@ fn zirSwitchCapture( | ... | @@ -8994,9 +8994,10 @@ fn zirSwitchCapture( |
| 8994 | const switch_info = zir_datas[capture_info.switch_inst].pl_node; | 8994 | const switch_info = zir_datas[capture_info.switch_inst].pl_node; |
| 8995 | const switch_extra = sema.code.extraData(Zir.Inst.SwitchBlock, switch_info.payload_index); | 8995 | const switch_extra = sema.code.extraData(Zir.Inst.SwitchBlock, switch_info.payload_index); |
| 8996 | const operand_src: LazySrcLoc = .{ .node_offset_switch_operand = switch_info.src_node }; | 8996 | const operand_src: LazySrcLoc = .{ .node_offset_switch_operand = switch_info.src_node }; |
| 8997 | const operand_is_ref = switch_extra.data.bits.is_ref; | | |
| 8998 | const cond_inst = Zir.refToIndex(switch_extra.data.operand).?; | 8997 | const cond_inst = Zir.refToIndex(switch_extra.data.operand).?; |
| 8999 | const cond_info = sema.code.instructions.items(.data)[cond_inst].un_node; | 8998 | const cond_info = zir_datas[cond_inst].un_node; |
| | 8999 | const cond_tag = sema.code.instructions.items(.tag)[cond_inst]; |
| | 9000 | const operand_is_ref = cond_tag == .switch_cond_ref; |
| 9000 | const operand_ptr = try sema.resolveInst(cond_info.operand); | 9001 | const operand_ptr = try sema.resolveInst(cond_info.operand); |
| 9001 | const operand_ptr_ty = sema.typeOf(operand_ptr); | 9002 | const operand_ptr_ty = sema.typeOf(operand_ptr); |
| 9002 | const operand_ty = if (operand_is_ref) operand_ptr_ty.childType() else operand_ptr_ty; | 9003 | const operand_ty = if (operand_is_ref) operand_ptr_ty.childType() else operand_ptr_ty; |
| ... | @@ -9009,7 +9010,6 @@ fn zirSwitchCapture( | ... | @@ -9009,7 +9010,6 @@ fn zirSwitchCapture( |
| 9009 | if (capture_info.prong_index == std.math.maxInt(@TypeOf(capture_info.prong_index))) { | 9010 | if (capture_info.prong_index == std.math.maxInt(@TypeOf(capture_info.prong_index))) { |
| 9010 | // It is the else/`_` prong. | 9011 | // It is the else/`_` prong. |
| 9011 | if (is_ref) { | 9012 | if (is_ref) { |
| 9012 | assert(operand_is_ref); | | |
| 9013 | return operand_ptr; | 9013 | return operand_ptr; |
| 9014 | } | 9014 | } |
| 9015 | | 9015 | |
| ... | @@ -9069,8 +9069,6 @@ fn zirSwitchCapture( | ... | @@ -9069,8 +9069,6 @@ fn zirSwitchCapture( |
| 9069 | } | 9069 | } |
| 9070 | | 9070 | |
| 9071 | if (is_ref) { | 9071 | if (is_ref) { |
| 9072 | assert(operand_is_ref); | | |
| 9073 | | | |
| 9074 | const field_ty_ptr = try Type.ptr(sema.arena, sema.mod, .{ | 9072 | const field_ty_ptr = try Type.ptr(sema.arena, sema.mod, .{ |
| 9075 | .pointee_type = first_field.ty, | 9073 | .pointee_type = first_field.ty, |
| 9076 | .@"addrspace" = .generic, | 9074 | .@"addrspace" = .generic, |
| ... | @@ -9131,7 +9129,6 @@ fn zirSwitchCapture( | ... | @@ -9131,7 +9129,6 @@ fn zirSwitchCapture( |
| 9131 | // In this case the capture value is just the passed-through value of the | 9129 | // In this case the capture value is just the passed-through value of the |
| 9132 | // switch condition. | 9130 | // switch condition. |
| 9133 | if (is_ref) { | 9131 | if (is_ref) { |
| 9134 | assert(operand_is_ref); | | |
| 9135 | return operand_ptr; | 9132 | return operand_ptr; |
| 9136 | } else { | 9133 | } else { |
| 9137 | return operand; | 9134 | return operand; |