| ... | @@ -12304,6 +12304,7 @@ fn analyzeSwitchRuntimeBlock( | ... | @@ -12304,6 +12304,7 @@ fn analyzeSwitchRuntimeBlock( |
| 12304 | extra_index += info.body_len; | 12304 | extra_index += info.body_len; |
| 12305 | | 12305 | |
| 12306 | case_block.instructions.shrinkRetainingCapacity(0); | 12306 | case_block.instructions.shrinkRetainingCapacity(0); |
| | 12307 | case_block.error_return_trace_index = child_block.error_return_trace_index; |
| 12307 | | 12308 | |
| 12308 | const item = case_vals.items[scalar_i]; | 12309 | const item = case_vals.items[scalar_i]; |
| 12309 | // `item` is already guaranteed to be constant known. | 12310 | // `item` is already guaranteed to be constant known. |
| ... | @@ -12361,6 +12362,7 @@ fn analyzeSwitchRuntimeBlock( | ... | @@ -12361,6 +12362,7 @@ fn analyzeSwitchRuntimeBlock( |
| 12361 | case_val_idx += items_len; | 12362 | case_val_idx += items_len; |
| 12362 | | 12363 | |
| 12363 | case_block.instructions.shrinkRetainingCapacity(0); | 12364 | case_block.instructions.shrinkRetainingCapacity(0); |
| | 12365 | case_block.error_return_trace_index = child_block.error_return_trace_index; |
| 12364 | | 12366 | |
| 12365 | // Generate all possible cases as scalar prongs. | 12367 | // Generate all possible cases as scalar prongs. |
| 12366 | if (info.is_inline) { | 12368 | if (info.is_inline) { |
| ... | @@ -12392,6 +12394,7 @@ fn analyzeSwitchRuntimeBlock( | ... | @@ -12392,6 +12394,7 @@ fn analyzeSwitchRuntimeBlock( |
| 12392 | const item_ref = Air.internedToRef(item.toIntern()); | 12394 | const item_ref = Air.internedToRef(item.toIntern()); |
| 12393 | | 12395 | |
| 12394 | case_block.instructions.shrinkRetainingCapacity(0); | 12396 | case_block.instructions.shrinkRetainingCapacity(0); |
| | 12397 | case_block.error_return_trace_index = child_block.error_return_trace_index; |
| 12395 | | 12398 | |
| 12396 | if (emit_bb) sema.emitBackwardBranch(block, .unneeded) catch |err| switch (err) { | 12399 | if (emit_bb) sema.emitBackwardBranch(block, .unneeded) catch |err| switch (err) { |
| 12397 | error.NeededSourceLocation => { | 12400 | error.NeededSourceLocation => { |
| ... | @@ -12431,6 +12434,7 @@ fn analyzeSwitchRuntimeBlock( | ... | @@ -12431,6 +12434,7 @@ fn analyzeSwitchRuntimeBlock( |
| 12431 | cases_len += 1; | 12434 | cases_len += 1; |
| 12432 | | 12435 | |
| 12433 | case_block.instructions.shrinkRetainingCapacity(0); | 12436 | case_block.instructions.shrinkRetainingCapacity(0); |
| | 12437 | case_block.error_return_trace_index = child_block.error_return_trace_index; |
| 12434 | | 12438 | |
| 12435 | const analyze_body = if (union_originally) blk: { | 12439 | const analyze_body = if (union_originally) blk: { |
| 12436 | const item_val = sema.resolveConstDefinedValue(block, .unneeded, item, undefined) catch unreachable; | 12440 | const item_val = sema.resolveConstDefinedValue(block, .unneeded, item, undefined) catch unreachable; |
| ... | @@ -12576,6 +12580,7 @@ fn analyzeSwitchRuntimeBlock( | ... | @@ -12576,6 +12580,7 @@ fn analyzeSwitchRuntimeBlock( |
| 12576 | defer gpa.free(cond_body); | 12580 | defer gpa.free(cond_body); |
| 12577 | | 12581 | |
| 12578 | case_block.instructions.shrinkRetainingCapacity(0); | 12582 | case_block.instructions.shrinkRetainingCapacity(0); |
| | 12583 | case_block.error_return_trace_index = child_block.error_return_trace_index; |
| 12579 | | 12584 | |
| 12580 | const body = sema.code.bodySlice(extra_index, info.body_len); | 12585 | const body = sema.code.bodySlice(extra_index, info.body_len); |
| 12581 | extra_index += info.body_len; | 12586 | extra_index += info.body_len; |
| ... | @@ -12636,6 +12641,7 @@ fn analyzeSwitchRuntimeBlock( | ... | @@ -12636,6 +12641,7 @@ fn analyzeSwitchRuntimeBlock( |
| 12636 | const item_ref = Air.internedToRef(item_val.toIntern()); | 12641 | const item_ref = Air.internedToRef(item_val.toIntern()); |
| 12637 | | 12642 | |
| 12638 | case_block.instructions.shrinkRetainingCapacity(0); | 12643 | case_block.instructions.shrinkRetainingCapacity(0); |
| | 12644 | case_block.error_return_trace_index = child_block.error_return_trace_index; |
| 12639 | | 12645 | |
| 12640 | const analyze_body = if (union_originally) blk: { | 12646 | const analyze_body = if (union_originally) blk: { |
| 12641 | const field_ty = maybe_union_ty.unionFieldType(item_val, mod).?; | 12647 | const field_ty = maybe_union_ty.unionFieldType(item_val, mod).?; |
| ... | @@ -12686,6 +12692,7 @@ fn analyzeSwitchRuntimeBlock( | ... | @@ -12686,6 +12692,7 @@ fn analyzeSwitchRuntimeBlock( |
| 12686 | const item_ref = Air.internedToRef(item_val); | 12692 | const item_ref = Air.internedToRef(item_val); |
| 12687 | | 12693 | |
| 12688 | case_block.instructions.shrinkRetainingCapacity(0); | 12694 | case_block.instructions.shrinkRetainingCapacity(0); |
| | 12695 | case_block.error_return_trace_index = child_block.error_return_trace_index; |
| 12689 | | 12696 | |
| 12690 | if (emit_bb) try sema.emitBackwardBranch(block, special_prong_src); | 12697 | if (emit_bb) try sema.emitBackwardBranch(block, special_prong_src); |
| 12691 | emit_bb = true; | 12698 | emit_bb = true; |
| ... | @@ -12716,6 +12723,7 @@ fn analyzeSwitchRuntimeBlock( | ... | @@ -12716,6 +12723,7 @@ fn analyzeSwitchRuntimeBlock( |
| 12716 | const item_ref = Air.internedToRef(cur); | 12723 | const item_ref = Air.internedToRef(cur); |
| 12717 | | 12724 | |
| 12718 | case_block.instructions.shrinkRetainingCapacity(0); | 12725 | case_block.instructions.shrinkRetainingCapacity(0); |
| | 12726 | case_block.error_return_trace_index = child_block.error_return_trace_index; |
| 12719 | | 12727 | |
| 12720 | if (emit_bb) try sema.emitBackwardBranch(block, special_prong_src); | 12728 | if (emit_bb) try sema.emitBackwardBranch(block, special_prong_src); |
| 12721 | emit_bb = true; | 12729 | emit_bb = true; |
| ... | @@ -12743,6 +12751,7 @@ fn analyzeSwitchRuntimeBlock( | ... | @@ -12743,6 +12751,7 @@ fn analyzeSwitchRuntimeBlock( |
| 12743 | cases_len += 1; | 12751 | cases_len += 1; |
| 12744 | | 12752 | |
| 12745 | case_block.instructions.shrinkRetainingCapacity(0); | 12753 | case_block.instructions.shrinkRetainingCapacity(0); |
| | 12754 | case_block.error_return_trace_index = child_block.error_return_trace_index; |
| 12746 | | 12755 | |
| 12747 | if (emit_bb) try sema.emitBackwardBranch(block, special_prong_src); | 12756 | if (emit_bb) try sema.emitBackwardBranch(block, special_prong_src); |
| 12748 | emit_bb = true; | 12757 | emit_bb = true; |
| ... | @@ -12768,6 +12777,7 @@ fn analyzeSwitchRuntimeBlock( | ... | @@ -12768,6 +12777,7 @@ fn analyzeSwitchRuntimeBlock( |
| 12768 | cases_len += 1; | 12777 | cases_len += 1; |
| 12769 | | 12778 | |
| 12770 | case_block.instructions.shrinkRetainingCapacity(0); | 12779 | case_block.instructions.shrinkRetainingCapacity(0); |
| | 12780 | case_block.error_return_trace_index = child_block.error_return_trace_index; |
| 12771 | | 12781 | |
| 12772 | if (emit_bb) try sema.emitBackwardBranch(block, special_prong_src); | 12782 | if (emit_bb) try sema.emitBackwardBranch(block, special_prong_src); |
| 12773 | emit_bb = true; | 12783 | emit_bb = true; |
| ... | @@ -12796,6 +12806,7 @@ fn analyzeSwitchRuntimeBlock( | ... | @@ -12796,6 +12806,7 @@ fn analyzeSwitchRuntimeBlock( |
| 12796 | }; | 12806 | }; |
| 12797 | | 12807 | |
| 12798 | case_block.instructions.shrinkRetainingCapacity(0); | 12808 | case_block.instructions.shrinkRetainingCapacity(0); |
| | 12809 | case_block.error_return_trace_index = child_block.error_return_trace_index; |
| 12799 | | 12810 | |
| 12800 | if (mod.backendSupportsFeature(.is_named_enum_value) and | 12811 | if (mod.backendSupportsFeature(.is_named_enum_value) and |
| 12801 | special.body.len != 0 and block.wantSafety() and | 12812 | special.body.len != 0 and block.wantSafety() and |