[Issue 285] New: Struct method null pointer assert has line number of "0"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 12 15:29:25 PDT 2006


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

           Summary: Struct method null pointer assert has line number of "0"
           Product: D
           Version: 0.163
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: jarrett.billingsley at gmail.com


struct S
{
        void fork()
        {

        }
}

void main()
{
        S* s = null;
        s.fork();
}

This causes an AssertError with the correct module name, but with a line number
of 0, which is really, really unhelpful.

I didn't know DMD even inserted this null check, I think it's pretty cool :) 
Would be nice if it included the message "struct 'this' pointer is null" or
"struct method called through null pointer" or something along those lines.


-- 




More information about the Digitalmars-d-bugs mailing list