dereferencing null

Peter Alexander peter.alexander.au at gmail.com
Fri Mar 2 13:26:11 PST 2012


On Friday, 2 March 2012 at 10:01:32 UTC, Daniel Murphy wrote:
> "Peter Alexander" <peter.alexander.au at gmail.com> wrote in 
> message
> news:vicaibqyaerogseqsjbe at forum.dlang.org...
>>>
>>> It's defined. The operating system protects you. You get a 
>>> segfault on *nix and
>>> an access violation on Windows.
>>
>> False.
>>
>> [snip]
>>
>> You only get an error if there is a memory access involved 
>> (vtable, member data etc.)
>>
>
> It _is_ defined, you get an access violation whenever there's a 
> dereference.
> Yes, you can call some types of member functions without any 
> dereferences,
> but this is alse well defined and sometimes quite useful.

Ok, if it is defined, then please tell me what the defined 
behaviour of my code snippet is.


More information about the Digitalmars-d mailing list