www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7789] New: [CTFE] null pointer exception on setting array length

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

           Summary: [CTFE] null pointer exception on setting array length
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dawg dawgfoto.de



cat > bug.d << CODE
struct S
{
    size_t foo()
    {
        _ary.length += 1;
        return _ary.length;
    }

    int[] _ary;
}

enum len = S().foo();
CODE

dmd -c bug

--------

Happens only if array is a struct field and when
read-assign on length (pre/post-increment or opAssign).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 28 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7789




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/e9b87a059a3291927c6d9f65a8c748996e59b01b
Fix issue 7789 [CTFE] null pointer exception on setting array length

https://github.com/D-Programming-Language/dmd/commit/b79b3f8a54daceed0e4c7519d6822a453f2ef7ba


Fix issue 7789 [CTFE] null pointer exception on setting array length

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 28 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7789


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 28 2012