www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6684] New: Wrong code for null-initializing a class with alias this.

http://d.puremagic.com/issues/show_bug.cgi?id=6684

           Summary: Wrong code for null-initializing a class with alias
                    this.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch



class Foo{
    string bar;
    alias bar this;
}

void main(){
    Foo foo = null; // segmentation fault at runtime
}

The compiler attempts to assign to foo's 'bar' field, instead of initializing
the class reference with zero. That always results in a segmentation fault.

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