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.
https://github.com/D-Programming-Language/dmd/pull/860
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