Bug 19722 – botched implementation of semantic3Errors causes compiler assert fail

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-03-06T12:44:04Z
Last change time
2019-03-07T09:21:58Z
Keywords
pull
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2019-03-06T12:44:04Z
Introduced by https://github.com/dlang/dmd/pull/5075 Specifically, the `semantic3Errors` can be set when gagged, but remain set when later ungagged. In opover.d, a function looked up with `semantic3Errors` can cause another expression to be set to `new ErrorExp()`. This expression then causes a cascaded error in `StatementSemanticVisitor.visit(ExpStatement)` where the `return setError()` is executed. `setError()` asserts if the global error count is not set. If that assert is disabled, another one asserts in `e2ir.d` which is not expecting an `ErrorStatement`. It's hard to come up with a non-Phobos test case for this due to the massive complexity of Phobos.
Comment #1 by dlang-bot — 2019-03-07T01:35:30Z
@WalterBright created dlang/dmd pull request #9425 "partially address Issue 19722 - botched implementation of semantic3Er…" fixing this issue: - partially address Issue 19722 - botched implementation of semantic3Errors causes compiler assert fail https://github.com/dlang/dmd/pull/9425
Comment #2 by bugzilla — 2019-03-07T01:37:12Z
Comment #3 by dlang-bot — 2019-03-07T09:21:58Z
dlang/dmd pull request #9425 "partially address Issue 19722 - botched implementation of semantic3Er…" was merged into master: - 63ac6902e763b439cf3c843f25c3ddf8dc13acaa by Walter Bright: partially address Issue 19722 - botched implementation of semantic3Errors causes compiler assert fail https://github.com/dlang/dmd/pull/9425