Prototype of Ownership/Borrowing System for D

Walter Bright newshound2 at digitalmars.com
Thu Nov 21 11:09:06 UTC 2019


On 11/20/2019 7:47 PM, Doc Andrew wrote:
> And honestly, knowing whether a pointer is in an undefined state is still a very
> useful piece of information that the flow analysis would provide.
> Dereferencing a pointer of unknown provenance should be an error in @live code,
> no different than null.

That's what I considered; there would be so many "cry wolf" false positives it 
would be useless.

Besides, the only way a null pointer dereference could result in memory 
corruption is if it comes with an offset that is larger than the protected 
memory zone at address 0. I.e. it's very unlikely. It's so unlikely I've 
literally never had one (but I've had lots and lots of null pointer seg faults).


More information about the Digitalmars-d mailing list