Bug 7784 – ICE with self-referencing literals

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-03-26T17:53:00Z
Last change time
2012-04-14T20:27:39Z
Keywords
CTFE, ice, pull
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2012-03-26T17:53:04Z
cat > bug.d << CODE struct Foo { void bug() { // cyclic reference tab["A"] = Bar(&this); auto pbar = "A" in tab; // triggers stack overflow in Expression::apply for hasSideEffect auto bar = *pbar; } Bar[string] tab; } struct Bar { Foo* foo; int val; } int ctfe() { auto foo = Foo(); foo.bug(); return 0; } enum run = ctfe(); CODE -------- We should probably flag all literal expression during visiting and either skip them or return a different apply result.
Comment #1 by clugdbug — 2012-04-04T11:54:04Z
Comment #2 by github-bugzilla — 2012-04-14T18:40:39Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/91f3179ea3e9b622e79ebc6b31b66236f1363964 Fix issue 7784 CTFE ICE with self-referencing AA literals https://github.com/D-Programming-Language/dmd/commit/b7fd092bdc4cc746995cf2c578c4c7bcbc3ebe56 Merge pull request #860 from donc/stackoverflow7784 Fix issue 7784 CTFE ICE with self-referencing AA literals