www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6030] New: Segmentation fault with method overloading and alias this

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

           Summary: Segmentation fault with method overloading and alias
                    this
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: robert octarineparrot.com



19:38:10 BST ---
struct A
{
    static A a;
    alias a this;
}

struct B
{
    int opSlice(size_t, size_t);
    int opSlice(size_t, A);
}

void main()
{
    B b;
    b[0..A];
}

Causes a segmentation fault using the latest git. Possibly related to issue


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


Trass3r <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrmocool gmx.de



$ gdb --batch -ex 'run test4.d' -ex 'bt 25' dmd
Program received signal SIGSEGV, Segmentation fault.
0x0000000000517f40 in aliasthisConvTo (ad=Cannot access memory at address
0x7fffff7fefe8) at mtype.c:7193
7193    {

0x7fffff7fefe8) at mtype.c:7193

to=0x8631d0) at mtype.c:7269

to=0x8631d0) at mtype.c:7213

to=0x8631d0) at mtype.c:7269

to=0x8631d0) at mtype.c:7213

to=0x8631d0) at mtype.c:7269

to=0x8631d0) at mtype.c:7213
...

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


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |k.hara.pg gmail.com



Mutually recursion version.

struct A
{
    static B b;
    alias b this;
}

struct B
{
    static A a;
    alias a this;
}

struct C
{
    int opSlice(size_t, size_t){ return 0; }
    int opSlice(size_t, A){ return 0; }
}

void main()
{
    C c;
    c[0..A];
}

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


Trass3r <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE



This has nothing to do with method overloading.
It's a stack overflow caused by aliasthisConvTo.

*** This issue has been marked as a duplicate of issue 6029 ***

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