Memory safe in D

Walter Bright newshound2 at digitalmars.com
Tue Mar 12 17:42:14 UTC 2024


On 3/12/2024 6:57 AM, Steven Schveighoffer wrote:
> I may have mentioned this before, but the way to fix this is in `@safe` code, 
> before each reference with a constant offset that you know to be greater than 
> one page, validate the root pointer is not null.

I had thought the compiler already checked for that. But testing shows it does 
not. I wonder if there was a PR to remove it?

> FWIW, I was actually talking about environments where the null page does not 
> segfault, like in a kernel.

I wonder why anyone would design it that way.



More information about the Digitalmars-d mailing list