https://issues.dlang.org/show_bug.cgi?id=20903
Issue ID: 20903
Summary: seg fault on long signed divide overflow
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
The following:
long test() {
long r = 0x8000_0000_0000_0000L;
long x = -1L;
return r / x; // crashes here
}
import core.stdc.stdio;
int main() {
printf("result: %llx\n", test());
return 0;
}
crashes when compiled with -O on 64 bit code.
--