[Issue 16402] New: ICE when reinterpreting a function as a long[2]
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Aug 18 07:14:48 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16402
Issue ID: 16402
Summary: ICE when reinterpreting a function as a long[2]
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: cauterite at gmail.com
( https://dpaste.dzfl.pl/01922868e611 )
void f() {};
void main() {
auto X = *cast(long[2]*) &f;
};
// Internal error: backend\cod2.c 3971
The `2` in `long[2]` can be any number > 1.
On x86-32 the same bug is also triggered by `int[2]` and `uint[2]`.
This works fine:
auto Ptr = cast(long[2]*) &f;
auto X = *Ptr;
It can also be triggered with the enclosing function:
void main() {
auto X = *cast(long[2]*) &main; // Internal error …
};
--
More information about the Digitalmars-d-bugs
mailing list