www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21110] New: OOB memory access, safety violation

https://issues.dlang.org/show_bug.cgi?id=21110

          Issue ID: 21110
           Summary: OOB memory access, safety violation
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Other
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bcarneal11 gmail.com

void main() {
    import std.stdio : writeln;

    int[] dst;
    int[] a;
    int[] b;
    a.length = 3;
    b.length = 3;
    dst.length = 4;
    dst[] = a[] + b[];
    writeln(dst[3]);
}

Prior to 2.077, per Steven Schveighoffer, the above safely failed with an array
violation.  Currently on his and my test machines, the above runs to completion
printing out some number (402696894 on my machine, 402653184 on his). 
Annotating main with  safe didn't change anything.

--
Aug 03 2020