713 – circular const definitions with module operator "." cause the compiler to segfault

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 713 - circular const definitions with module operator "." cause the compiler to segfault
Summary: circular const definitions with module operator "." cause the compiler to seg...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Linux
: P2 normal
Assignee: Walter Bright
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
Reported: 2006年12月22日 07:22 UTC by Thomas Kühne
Modified: 2014年02月15日 13:19 UTC (History)
2 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 2006年12月22日 07:22:24 UTC
(Originally posted by Wang Zhen <nehzgnaw@gmail.com> on 2006年02月17日
as news:dt4ahd2ドルikp2ドル@digitaldaemon.com)
segfaults:
#
# const int a = .b;
# const int b = a;
#
#
# const int a = b;
# const int b = .a;
#
doesn't segfault:
#
# const int a = .b;
# const int b = .a;
#
#
# const int a = b;
# const int b = a;
#
test cases:
http://dstress.kuehne.cn/nocompile/c/const_32_A.d
http://dstress.kuehne.cn/nocompile/c/const_32_B.d
http://dstress.kuehne.cn/nocompile/c/const_32_C.d
http://dstress.kuehne.cn/nocompile/c/const_32_D.d 
Comment 1 Don 2009年04月02日 15:03:41 UTC
On D1, this now generates a "Stack overflow".
On D2, the equivalent code:
enum int a = .b;
enum int b = a;
hangs.
Comment 2 Don 2009年05月14日 04:56:00 UTC
Fixed DMD2.030 and 1.045


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