[Issue 12588] Segfault on X86_64 assigning std.complex to array
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jun 8 14:33:30 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12588
--- Comment #2 from Element 126 <dlang.element126 at gmail.com> ---
DMD 2.065.0 64bit. Arch Linux.
Using array operations like `array[] = complex(1.0,2.0);` with the
`Complex!double` struct may cause a segmentation fault when compiled with DMD
64 bit. See the attached test case.
This code works and gives expected results with GDC 4.9.0-2 and LDC2 0.12.1-2,
or with DMD when compiled with the `-m32` switch. It is specific to the
`double` type, and works with `Complex!float` and `Complex!real`.
Interestingly, and although the segfault seems deterministic, uncommenting the
call to `writeln()` on the previous line prevents it, but the array operation
then does nothing (the array keeps the initial values, not necessarily
`nan+nani` like in the test case).
--
More information about the Digitalmars-d-bugs
mailing list