Bug 15667 – dmd infinite loop on invalid syntax.

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-02-10T01:01:00Z
Last change time
2016-02-18T00:50:00Z
Keywords
ice, pull
Assigned to
nobody
Creator
john.loughran.colvin

Comments

Comment #0 by john.loughran.colvin — 2016-02-10T01:01:55Z
% cat traits.d template staticIndexOf(T) { enum staticIndexOf = genericIndexOf!T; } template genericIndexOf(args...) { alias e = args; alias tuple = args; alias tail = tuple; enum next = genericIndexOf!(e, tail); } alias X = ; static if (staticIndexOf!X) % cat generator.d unittest { import traits; } % dmd -unittest generator.d traits.d(16): Error: basic type expected, not ; traits.d(20): Error: declaration expected following attribute, not EOF and then it just hangs forever, endlessly allocating memory.
Comment #1 by k.hara.pg — 2016-02-17T16:37:18Z
Comment #2 by github-bugzilla — 2016-02-18T00:50:00Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/354cca32f1b93cca073a483a463ef36e96bee67e fix Issue 15667 - dmd infinite loop on invalid syntax https://github.com/D-Programming-Language/dmd/commit/fe04c82778e1c7157bd6f2ac10ca3b8cbe0b7229 Merge pull request #5463 from 9rnsr/fix15667 Issue 15667 - dmd infinite loop on invalid syntax