October 25, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6851

           Summary: [CTFE] Cannot deref pointer passed by argument
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: k.hara.pg@gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg@gmail.com> 2011-10-25 05:09:15 PDT ---
void setn(int* pn)
{
    *pn = 20;
}
void test()
{
    int n = 0;
    auto pn = &n;
    *pn = 10;
    assert(n == 10);
    setn(&n);
}
static assert({ test(); return true; }());

----
Output:

test.d(3): Error: cannot dereference invalid pointer *pn
test.d(11):        called from here: setn(& n)
test.d(13):        called from here: test()
test.d(13):        called from here: delegate @system bool()
{
test();
return true;
}
()
test.d(13): Error: static assert  (delegate @system bool()
{
test();
return true;
}
()) is not evaluatable at compile time

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


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> 2011-11-03 16:00:50 PDT ---
https://github.com/D-Programming-Language/dmd/commit/eec4830dff9fa5653fb5e261660ea5596269085a

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

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