D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19722 - botched implementation of semantic3Errors causes compiler assert fail
Summary: botched implementation of semantic3Errors causes compiler assert fail
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2019-03-06 12:44 UTC by Walter Bright
Modified: 2019-03-07 09:21 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Walter Bright 2019-03-06 12:44:04 UTC
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 Dlang Bot 2019-03-07 01:35:30 UTC
@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 Walter Bright 2019-03-07 01:37:12 UTC
Also related to https://github.com/dlang/dmd/pull/4950
Comment 3 Dlang Bot 2019-03-07 09:21:58 UTC
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