null dereference exception vs. segfault?
bearophile
bearophileHUGS at lycos.com
Mon Aug 2 08:57:31 PDT 2010
Jeffrey Yasskin:
> That's good to know. Unfortunately, reading through a null pointer
> does cause undefined behavior: it's not a guaranteed segfault.
> Consider an object with a large array at the beginning, which pushes
> later members past the empty pages at the beginning of the address
> space. I don't suppose the D compiler watches for such large objects
> and emits actual null checks before indexing into them?
I am not expert enough to give you a good answer about this, but do some tests :-) And later if you want you may say the same things in the main D newsgroup.
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list