1054 – regression: circular aliases cause compiler stack overflow

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1054 - regression: circular aliases cause compiler stack overflow
Summary: regression: circular aliases cause compiler stack overflow
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Linux
: P3 regression
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code
: 1063 (view as issue list)
Depends on:
Blocks:
Reported: 2007年03月12日 01:24 UTC by Thomas Kühne
Modified: 2014年02月16日 15:21 UTC (History)
4 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Thomas Kühne 2007年03月12日 01:24:53 UTC
# alias a b;
# alias b a;
#
# b x;
dmd -c a.d -> segfaults
# alias a b;
# alias b a;
dmd -c a.d -> compiles even though it shouldn't
test cases:
http://dstress.kuehne.cn/nocompile/a/alias_30_G.d
http://dstress.kuehne.cn/nocompile/a/alias_30_J.d
http://dstress.kuehne.cn/nocompile/a/alias_30_K.d
http://dstress.kuehne.cn/nocompile/e/enum_44_E.d 
Comment 1 Thomas Kühne 2007年03月29日 14:08:45 UTC
*** Bug 1063 has been marked as a duplicate of this bug. ***
Comment 2 Don 2009年04月03日 02:28:50 UTC
The first case no longer segfaults -- it stack overflows instead, and the second case now generates an error.
On DMD1.042, the first case displays:
fog.d(2): Error: alias fog.a recursive alias declaration
Stack overflow
and on DMD2.027, it gets caught in an infinite loop:
fog.d(2): Error: alias fog.a recursive alias declaration
fog.d(2): Error: alias fog.a recursive alias declaration
fog.d(2): Error: alias fog.a recursive alias declaration
fog.d(2): Error: alias fog.a recursive alias declaration
fog.d(2): Error: alias fog.a recursive alias declaration
Comment 3 Don 2009年05月14日 05:26:01 UTC
This is fixed in DMD2.030, but not in DMD1.045.
alias a b;
alias b a;
a y;
---
ice.d(544): Error: alias ice.a recursive alias declaration
Stack overflow
----------
Comment 4 Walter Bright 2009年07月09日 02:53:56 UTC
Fixed dmd 1.046


AltStyle によって変換されたページ (->オリジナル) /