mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
AstGen: do not generate defers at unreachable end of block
Resolves: #8822
This commit is contained in:
parent
f6abf022b7
commit
07d8740882
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user