digitalmars.D.bugs - [Issue 19175] New: safe code can escape local array references
- d-bugmail puremagic.com (27/27) Aug 17 2018 https://issues.dlang.org/show_bug.cgi?id=19175
https://issues.dlang.org/show_bug.cgi?id=19175 Issue ID: 19175 Summary: safe code can escape local array references Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: critical Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: peter.alexander.au gmail.com -------- import std.algorithm, std.stdio; safe: auto foo() { int[6] xs = [0, 1, 2, 3, 4, 5]; return xs[].map!(x => x); } void main() { writeln(foo()); } -------- Observed: this compiles and (for me) prints [0, 0, -2132056872, 22008, 0, 0]. Expected: fail to compile with error about the escaped local reference. --
Aug 17 2018