authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-02-27 02:15:32+00:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-02-29 23:38:17+00:00
log07d8740882616b18a3dd81629b1ad0b698376399
treeaea3ac67e4ae1d9ce9affe3a7c29edf6b5515a47
parentf6abf022b790847e6145569241e4e5685abf359c
signaturelock-open Commit is signed but in an unrecognized format.

AstGen: do not generate defers at unreachable end of block

Resolves: #8822

1 files changed, 3 insertions(+), 1 deletions(-)

lib/std/zig/AstGen.zig+3-1
......@@ -2563,7 +2563,9 @@ fn blockExprStmts(gz: *GenZir, parent_scope: *Scope, statements: []const Ast.Nod
25632563 }
25642564 }
25652565
2566 try genDefers(gz, parent_scope, scope, .normal_only);
2566 if (noreturn_src_node == 0) {
2567 try genDefers(gz, parent_scope, scope, .normal_only);
2568 }
25672569 try checkUsed(gz, parent_scope, scope);
25682570}
25692571