DIP1000: Memory Safety in a Modern System Programming Language Pt.1

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Wed Jun 22 21:58:07 UTC 2022


On Wednesday, 22 June 2022 at 21:20:33 UTC, Steven Schveighoffer 
wrote:
> Full flow analysis will be defeatable by more complex 
> situations:
>
> ```d
> int *p = null;
> if(alwaysEvaluateToFalse()) p = &arg;
> else p = new int(5);
> return p;
> ```
>
> That would take a lot of effort just to prove it shouldn't be 
> scope.

I guess this is the wrong forum, but two quick points.

Some C programmers reuse variables extensively, those programmers 
will be confused or annoyed.

The analysis can be done after an optimization pass, so at least 
the simple cases go through smoothly.




More information about the Digitalmars-d-announce mailing list