[RFC] Throwing an exception with null pointers

Dave P. dave287091 at gmail.com
Wed Apr 16 20:16:54 UTC 2025


On Wednesday, 16 April 2025 at 19:58:45 UTC, Walter Bright wrote:
> The focus of safe code in D is preventing memory corruption, 
> not null pointer dereference seg faults or other programming 
> bugs.
>
> A null pointer deference may be a symptom of memory corruption 
> or some logic bug, but it does not cause memory corruption.
>
> D has many aspects that reduce the likelihood of bugs (such as 
> no variable shadowing), but that is not what safe is about.
>
> (Yes I know that if there's a constant offset to a null pointer 
> larger than the guard page, it can cause memory corruption.)

The 0 address on WASM is writable, which has burned me many times.


More information about the Digitalmars-d mailing list