| ... | @@ -4687,6 +4687,10 @@ fn resolveBlockBody( | ... | @@ -4687,6 +4687,10 @@ fn resolveBlockBody( |
| 4687 | return sema.analyzeBlockBody(parent_block, src, child_block, merges); | 4687 | return sema.analyzeBlockBody(parent_block, src, child_block, merges); |
| 4688 | } else |err| switch (err) { | 4688 | } else |err| switch (err) { |
| 4689 | error.ComptimeBreak => { | 4689 | error.ComptimeBreak => { |
| | 4690 | // Comptime control flow is happening, however child_block may still contain |
| | 4691 | // runtime instructions which need to be copied to the parent block. |
| | 4692 | try parent_block.instructions.appendSlice(sema.gpa, child_block.instructions.items); |
| | 4693 | |
| 4690 | const break_inst = sema.comptime_break_inst; | 4694 | const break_inst = sema.comptime_break_inst; |
| 4691 | const break_data = sema.code.instructions.items(.data)[break_inst].@"break"; | 4695 | const break_data = sema.code.instructions.items(.data)[break_inst].@"break"; |
| 4692 | if (break_data.block_inst == body_inst) { | 4696 | if (break_data.block_inst == body_inst) { |