www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15295] New: Another wrong code bug with -inline and


          Issue ID: 15295
           Summary: Another wrong code bug with -inline and
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: k.hara.pg gmail.com

Separated from:


I'm getting this again with dmd 2.069.

With the files below, running rdmd -g -inline main.d I get:

object.Error (0): Access Violation
0x0040221A in
0x0040247F in void failsinline.FailsInline.failsinline() at
0x00402027 in _Dmain at E:\source\dice\main.d(7)
0x00402BF7 in D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv
0x00402BBB in void rt.dmain2._d_run_main(int, char**, extern (C) int
0x00402ABC in _d_run_main
0x004023F0 in main at E:\source\dice\main.d(7)
0x0041D0F5 in mainCRTStartup
0x77693744 in BaseThreadInitThunk
0x77BBA064 in RtlSetCurrentTransaction
0x77BBA02F in RtlSetCurrentTransaction

When removing the std.algorithm import from main.d or compiling without -inline
it works fine.

-- main.d --
import std.algorithm;
import failsinline;

void main()
  auto fail = new FailsInline();
-- main.d --

-- failsinline.d --
import std.algorithm : map;
import std.array : array;

class FailsInline
  void failsinline()
    auto transform = (int i) => i;
-- failsinline.d --

Nov 05 2015