[Issue 22365] Compiler crash: tcs.body_ null in StatementSemanticVisitor.visit(TryCatchStatement) in semantic3 pass (dmd/statementsem.d:3956)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jan 14 10:13:07 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22365
Dlang Bot <dlang-bot at dlang.rocks> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/dmd pull request #13516 "Fix 22365 - Don't crash for conditionally empty
body of a TryStatement" was merged into stable:
- 4b2b2af5c276f64334a8eb9daf0c00db83cb93d2 by MoonlightSentinel:
Fix 22365 - Don't crash for conditionally empty body of a TryStatement
The body may end up empty / null after `statementSemantic` if it only
contains conditionally compiled statements (`version`, `debug`, ...)
whose conditions are not met.
This only triggered for the `-preview=dtorfields` rewrite because it
didn't wrap the empty body into an additional `ScopeStatement`. But it
should be sufficient to check during `TryStatement` semantic instead
of unconditionally allocating an additional node for this rare case.
https://github.com/dlang/dmd/pull/13516
--
More information about the Digitalmars-d-bugs
mailing list