[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
Wed Jan 12 22:25:10 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22365

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #5 from Dlang Bot <dlang-bot at dlang.rocks> ---
@MoonlightSentinel updated dlang/dmd pull request #13516 "Don't crash for
conditionally empty body of TryStatement" fixing this issue:

- 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