www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1243] New: inout args can point to null

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: shro8822 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.


-- 
May 22 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1243


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |enhancement




-- 
Jun 28 2007