Bug 18803 – just "static if" in nested import crashes dmd

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-04-27T15:07:48Z
Last change time
2018-04-30T19:34:57Z
Assigned to
No Owner
Creator
FeepingCreature

Comments

Comment #0 by default_357-line — 2018-04-27T15:07:48Z
Repro: a.d: void main() { import b; } b.d: static if Result: DMD crashes. This happens because StaticIfCondition is called with a null exp if parsing fails, but it checks for ErrorExp. PR in a moment.
Comment #1 by github-bugzilla — 2018-04-30T19:34:56Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/349869aa6835f4747a5a6f065d32857168ca1c59 Fix issue 18803: when errors occur while parsing a module, do not go on to run semantic3 on it. https://github.com/dlang/dmd/commit/17bc50adf341df645196017d374f871229b19793 Merge pull request #8211 from FeepingCreature/fix/issue-18803-handle-static-if-parse-failure-correctly Fix issue 18803: when failing to parse a module without errors, don't call semantic3 merged-on-behalf-of: Petar Kirov <[email protected]>