[Issue 14046] Overlapping dynamic array copy is allowed if struct contains postblit

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jan 26 01:27:43 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14046

--- Comment #1 from Denis Shelomovskij <verylonglogin.reg at gmail.com> ---
The reason is in case there is no postblit `_d_arraycopy` (which enforces
arrays don't overlap [1]) is called for copying and if there is a postblit
`_d_arrayassign` (which allows overlapping arrays [2]) is called.

[1]
https://github.com/D-Programming-Language/druntime/blob/a8c74e00fe21e7781bc6d6fa1773c12b7a1e63b7/src/rt/arraycat.d#L26
[2]
https://github.com/D-Programming-Language/druntime/blob/a8c74e00fe21e7781bc6d6fa1773c12b7a1e63b7/src/rt/arrayassign.d#L28

--


More information about the Digitalmars-d-bugs mailing list