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



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




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



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



*** 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



*** 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




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




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