D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.

Issue 5086

Summary: Regression(1.061): Stack overflow with recursive alias declaration
Product: D Reporter: Don <clugdbug>
Component: dmdAssignee: No Owner <nobody>
Status: RESOLVED FIXED
Severity: regression CC: bugzilla, ibuclaw, siegelords_abode
Priority: P2 Keywords: ice-on-invalid-code, patch
Version: D1 (retired)
Hardware: Other
OS: Windows
Attachments: issue5086
issue5086

Description Don 2010年10月20日 07:12:25 UTC
This is dstress nocompile/a/alias_30_J.d and nocompile/a/alias_30_K.d
---
alias a b;
alias b a;
 	
b x;
---
bug.d(7): Error: alias test0.a recursive alias declaration
Stack overflow
---
D1 only, worked in 1.061.
Doesn't happen if DMD is compiled in debug mode.
Comment 1 Don 2010年10月20日 07:17:56 UTC
And this is nocompile/c/const_34_A.d, which is also failing. In total, 5 dstress cases are now hitting a stack overflow because of this bug. D2 is not affected.
const auto a = a;
Comment 2 Don 2010年10月22日 00:45:53 UTC
Regression was introduced in 1.061 by the fix to bug 4016, in expression.c, DsymbolExp::semantic()
 //printf("Identifier '%s' is a variable, type '%s'\n", toChars(),
v->type->toChars());
 if (!type)
 {
+ if (!v->type && v->scope)
+ v->semantic(v->scope);
 type = v->type;
 if (!v->type)
 { error("forward reference of %s %s", v->kind(), v->toChars());
The code doesn't fail on D2, because v->scope is not set on D2.
Comment 3 Don 2010年11月12日 08:03:42 UTC
*** Issue 4794 has been marked as a duplicate of this issue. ***
Comment 4 Iain Buclaw 2011年04月20日 00:03:07 UTC
*** Issue 4892 has been marked as a duplicate of this issue. ***
Comment 5 Iain Buclaw 2011年04月20日 01:43:46 UTC
Created attachment 945 [details] 
issue5086
Patch for D1 - I'm not entirely sure on the correctness of the first hunk.
Comment 6 Iain Buclaw 2011年04月21日 07:32:10 UTC
Created attachment 946 [details] 
issue5086
Yep, that questionable change broke tango build - should now be sorted.

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