digitalmars.D - Local pointer escape under current DIP1000 implementation
- Yuxuan Shui (11/11) May 05 2017 Code:
- Andrei Alexandrescu (3/16) May 05 2017 Cool, thanks. Will discuss with Walter right now. Looks like an
Code: safe auto id(scope int *p) { int*[] a; a ~= p; return a; } safe int *bar() { int i; return id(&i)[0]; //pointer to local escaped } Compiles with -dip1000
May 05 2017
On 5/5/17 12:51 PM, Yuxuan Shui wrote:Code: safe auto id(scope int *p) { int*[] a; a ~= p; return a; } safe int *bar() { int i; return id(&i)[0]; //pointer to local escaped } Compiles with -dip1000Cool, thanks. Will discuss with Walter right now. Looks like an oversight - the append is not supposed to go through. -- Andrei
May 05 2017