[Issue 15295] New: Another wrong code bug with -inline and foreach/map/all
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Nov 5 22:08:01 PST 2015
https://issues.dlang.org/show_bug.cgi?id=15295
Issue ID: 15295
Summary: Another wrong code bug with -inline and
foreach/map/all
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Keywords: wrong-code
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: k.hara.pg at gmail.com
Separated from:
https://issues.dlang.org/show_bug.cgi?id=13244#c9
================================
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
----------------
0x00821014
0x0040221A in
D3std5array135__T5arrayTS3std9algorithm9iteration87__T9MapResultS67_D11failsinline11FailsInline7146BC2938FC1915EBA515935C5C811A
0x0040247F in void failsinline.FailsInline.failsinline() at
E:\source\dice\failsinline.d(9)
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
function(char[][])*).runAll()
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();
fail.failsinline();
}
-- main.d --
-- failsinline.d --
import std.algorithm : map;
import std.array : array;
class FailsInline
{
void failsinline()
{
auto transform = (int i) => i;
[0].map!transform.array;
}
}
-- failsinline.d --
--
More information about the Digitalmars-d-bugs
mailing list