www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13244] New: Wrong code with -inline and foreach/map/all


          Issue ID: 13244
           Summary: Wrong code with -inline and foreach/map/all
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Keywords: wrong-code
          Severity: critical
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: thecybershadow gmail.com

//////////////// test.d ///////////////
import std.algorithm;
import std.range;

void main()
    auto arr = [[cast(ubyte)1]];
    foreach (ref x; arr)
        1.iota.map!(c => x[c]).array();

Running this program results in an access violation when built with -inline.

Aug 03 2014