5086 – Regression(1.061): Stack overflow with recursive alias declaration

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5086 - Regression(1.061): Stack overflow with recursive alias declaration
Summary: Regression(1.061): Stack overflow with recursive alias declaration
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: Other Windows
: P2 regression
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code, patch
: 4794 4892 (view as issue list)
Depends on:
Blocks:
Reported: 2010年10月20日 07:12 UTC by Don
Modified: 2011年06月04日 14:56 UTC (History)
3 users (show)

See Also:


Attachments
issue5086 (910 bytes, patch)
2011年04月20日 01:43 UTC, Iain Buclaw
Details | Diff
issue5086 (1.10 KB, patch)
2011年04月21日 07:32 UTC, Iain Buclaw
Details | Diff
Show Obsolete (1) 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 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 によって変換されたページ (->オリジナル) /