Bug 17969 – [REG 2.077.0] dmd 2.077.0 crashes when computing mangling symbol for simple program
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-11-06T12:04:08Z
Last change time
2017-11-30T09:06:53Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Atila Neves
Comments
Comment #0 by atila.neves — 2017-11-06T12:04:08Z
This code causes dmd 2.070.0 to crash:
void foo() {
struct Data {
double value;
}
oops([Data()]);
}
void oops(Data)(Data[] data) {
import std.algorithm: map;
auto values = [data].map!(a => a.map!(b => b.value).sum);
}
Earlier versions aren't affected. Notice that `sum` isn't imported. If it is, the crash goes away. If `b.value` is replaced with `b.foo` (or any other name that doesn't exist in the struct), it also crashes, so it seems to have to do with the function failing to compile.
The stack trace points to _ZN7Mangler14mangleFuncTypeEP12TypeFunctionS1_hP4Type.
Comment #1 by ag0aep6g — 2017-11-06T17:58:44Z
Reduced:
----
alias fun = a => MapResult2!(b => b).sum;
int[] e;
static assert(!is(typeof(fun(e)) == void));
void foo() { fun(e); }
struct MapResult2(alias fun)
{
int[] _input;
}
----