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

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
Other
OS
Windows
Creation time
2010-10-20T07:12:00Z
Last change time
2011-06-04T14:56:37Z
Keywords
ice-on-invalid-code, patch
Assigned to
nobody
Creator
clugdbug

Attachments

IDFilenameSummaryContent-TypeSize
945issue5086.patchissue5086text/plain910
946issue5086.patchissue5086text/plain1131

Comments

Comment #0 by clugdbug — 2010-10-20T07:12:25Z
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 by clugdbug — 2010-10-20T07:17:56Z
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 by clugdbug — 2010-10-22T00:45:53Z
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 by clugdbug — 2010-11-12T08:03:42Z
*** Issue 4794 has been marked as a duplicate of this issue. ***
Comment #4 by ibuclaw — 2011-04-20T00:03:07Z
*** Issue 4892 has been marked as a duplicate of this issue. ***
Comment #5 by ibuclaw — 2011-04-20T01:43:46Z
Created attachment 945 issue5086 Patch for D1 - I'm not entirely sure on the correctness of the first hunk.
Comment #6 by ibuclaw — 2011-04-21T07:32:10Z
Created attachment 946 issue5086 Yep, that questionable change broke tango build - should now be sorted.
Comment #7 by bugzilla — 2011-06-04T14:56:37Z