[Issue 1243] New: inout args can point to null

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 22 14:09:08 PDT 2007


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

           Summary: inout args can point to null
           Product: D
           Version: 1.014
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: shro8822 at uidaho.edu


this seg-v's:

void main()
{
        char* t = null;
        fn(*t);
}

void fn(inout char j)
{
        j = 5;
}

I just spent about 10 minuets trying to figure out why something a lot like
that was failing.

In non release mode, DMD should put in an assert(_ !is null) when a pointer is
de referenced and used as an out or inout arg.


-- 



More information about the Digitalmars-d-bugs mailing list