| ... | @@ -574,9 +574,7 @@ pub const Builder = struct { | ... | @@ -574,9 +574,7 @@ pub const Builder = struct { |
| 574 | } | 574 | } |
| 575 | | 575 | |
| 576 | _ = try irb.genDefersForBlock(child_scope, outer_block_scope, Scope.Defer.Kind.ScopeExit); | 576 | _ = try irb.genDefersForBlock(child_scope, outer_block_scope, Scope.Defer.Kind.ScopeExit); |
| 577 | const result = try Instruction.Const.buildVoid(irb, child_scope, false); | 577 | return try Instruction.Const.buildVoid(irb, child_scope, true); |
| 578 | result.setGenerated(); | | |
| 579 | return result; | | |
| 580 | } | 578 | } |
| 581 | | 579 | |
| 582 | fn genDefersForBlock( | 580 | fn genDefersForBlock( |
| ... | @@ -648,8 +646,7 @@ pub async fn gen(module: *Module, body_node: *ast.Node, scope: *Scope, parsed_fi | ... | @@ -648,8 +646,7 @@ pub async fn gen(module: *Module, body_node: *ast.Node, scope: *Scope, parsed_fi |
| 648 | | 646 | |
| 649 | const result = try irb.genNode(body_node, scope, LVal.None); | 647 | const result = try irb.genNode(body_node, scope, LVal.None); |
| 650 | if (!result.isNoReturn()) { | 648 | if (!result.isNoReturn()) { |
| 651 | const void_inst = try Instruction.Const.buildVoid(&irb, scope, false); | 649 | (try Instruction.Return.build(&irb, scope, result)).setGenerated(); |
| 652 | (try Instruction.Return.build(&irb, scope, void_inst)).setGenerated(); | | |
| 653 | } | 650 | } |
| 654 | | 651 | |
| 655 | return irb.finish(); | 652 | return irb.finish(); |