mirror of
https://github.com/ziglang/zig.git
synced 2026-10-14 10:27:43 -04:00
AstGen: do not generate defers at unreachable end of block
Resolves: #8822
This commit is contained in:
1 file changed
+3
-1
@@ -2563,7 +2563,9 @@ fn blockExprStmts(gz: *GenZir, parent_scope: *Scope, statements: []const Ast.Nod
|
||||
}
|
||||
}
|
||||
|
||||
try genDefers(gz, parent_scope, scope, .normal_only);
|
||||
if (noreturn_src_node == 0) {
|
||||
try genDefers(gz, parent_scope, scope, .normal_only);
|
||||
}
|
||||
try checkUsed(gz, parent_scope, scope);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user