@@ -5251,8 +5251,10 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n
5251
5251
if (body_result == irb->codegen->invalid_instruction)
5252
5252
return body_result;
5253
5253
5254
- if (!instr_is_unreachable(body_result))
5254
+ if (!instr_is_unreachable(body_result)) {
5255
+ ir_mark_gen(ir_build_check_statement_is_void(irb, payload_scope, node->data.while_expr.body, body_result));
5255
5256
ir_mark_gen(ir_build_br(irb, payload_scope, node, continue_block, is_comptime));
5257
+ }
5256
5258
5257
5259
if (continue_expr_node) {
5258
5260
ir_set_cursor_at_end_and_append_block(irb, continue_block);
@@ -5331,8 +5333,10 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n
5331
5333
if (body_result == irb->codegen->invalid_instruction)
5332
5334
return body_result;
5333
5335
5334
- if (!instr_is_unreachable(body_result))
5336
+ if (!instr_is_unreachable(body_result)) {
5337
+ ir_mark_gen(ir_build_check_statement_is_void(irb, child_scope, node->data.while_expr.body, body_result));
5335
5338
ir_mark_gen(ir_build_br(irb, child_scope, node, continue_block, is_comptime));
5339
+ }
5336
5340
5337
5341
if (continue_expr_node) {
5338
5342
ir_set_cursor_at_end_and_append_block(irb, continue_block);
@@ -5392,8 +5396,10 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n
5392
5396
if (body_result == irb->codegen->invalid_instruction)
5393
5397
return body_result;
5394
5398
5395
- if (!instr_is_unreachable(body_result))
5399
+ if (!instr_is_unreachable(body_result)) {
5400
+ ir_mark_gen(ir_build_check_statement_is_void(irb, scope, node->data.while_expr.body, body_result));
5396
5401
ir_mark_gen(ir_build_br(irb, scope, node, continue_block, is_comptime));
5402
+ }
5397
5403
5398
5404
if (continue_expr_node) {
5399
5405
ir_set_cursor_at_end_and_append_block(irb, continue_block);
0 commit comments