Bug 8053 – Recursive alias this causes infinite loop

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-06T07:02:00Z
Last change time
2013-03-06T18:04:12Z
Keywords
ice, pull
Assigned to
nobody
Creator
simen.kjaras

Comments

Comment #0 by simen.kjaras — 2012-05-06T07:02:59Z
class A { B b; alias b this; } class B { A a; alias a this; } void main( ) { A a = 3; } The above code causes a stack overflow in DMD. The problem is there is no loop-detection in the alias this implementation, so it will try the same type over and over.
Comment #1 by k.hara.pg — 2012-06-26T01:22:31Z
*** Issue 8300 has been marked as a duplicate of this issue. ***
Comment #2 by k.hara.pg — 2012-06-27T19:44:13Z
Comment #3 by github-bugzilla — 2013-03-06T18:04:12Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ef9a73ca6719172c51b1abf0b94d238d1df87674 Merge pull request #1028 from 9rnsr/fix_aliasthis Issue 7437,7980,8053 - Partial fix for stack overflow with recursive alias this