[Issue 18996] Inserting a struct into an std.container Array causes SIGILL(4). Illegal Instruction.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jun 18 05:45:56 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18996
Basile B. <b2.temp at gmx.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |b2.temp at gmx.com
Hardware|x86_64 |All
--- Comment #3 from Basile B. <b2.temp at gmx.com> ---
This is caused by an operation on a string literal data, which are known to be
read-only.
For example:
---
void main(string[] arguments)
{
Array!string str;
str.insert("hello".idup);
}
---
works finely because string data are now on the heap, not in the segment where
the literal resides.
--
More information about the Digitalmars-d-bugs
mailing list