www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5086] New: Regression(1.062): Stack overflow with recursive alias declaration

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5086

           Summary: Regression(1.062): Stack overflow with recursive alias
                    declaration
           Product: D
           Version: D1
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au


--- Comment #0 from Don <clugdbug yahoo.com.au> 2010-10-20 07:12:25 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 20 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5086



--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-10-20 07:17:56 PDT ---
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;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 20 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5086


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Regression(1.062): Stack    |Regression(1.061): Stack
                   |overflow with recursive     |overflow with recursive
                   |alias declaration           |alias declaration


--- Comment #2 from Don <clugdbug yahoo.com.au> 2010-10-22 00:45:53 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 22 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5086


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw ubuntu.com


--- Comment #3 from Don <clugdbug yahoo.com.au> 2010-11-12 08:03:42 PST ---
*** Issue 4794 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 12 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5086


Iain Buclaw <ibuclaw ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |siegelords_abode yahoo.com


--- Comment #4 from Iain Buclaw <ibuclaw ubuntu.com> 2011-04-20 00:03:07 PDT ---
*** Issue 4892 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 20 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5086



--- Comment #5 from Iain Buclaw <ibuclaw ubuntu.com> 2011-04-20 01:43:46 PDT ---
Created an attachment (id=945)
issue5086

Patch for D1 - I'm not entirely sure on the correctness of the first hunk.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 20 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5086



--- Comment #6 from Iain Buclaw <ibuclaw ubuntu.com> 2011-04-21 07:32:10 PDT ---
Created an attachment (id=946)
issue5086

Yep, that questionable change broke tango build - should now be sorted.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 21 2011