Issue 15309: buffer/memoryview slice assignment uses only memcpy (original) (raw)

Issue15309

Created on 2012-07-09 21:21 by Ronny.Pfannschmidt, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg165127 - (view) Author: Ronny Pfannschmidt (Ronny.Pfannschmidt) Date: 2012-07-09 21:21
thats broken for assigning overlaping regions, the memcpy docs explicitly state that memmove should be used in overlap cases
msg165180 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2012-07-10 09:17
Could you please state the Python version and line numbers in memoryobject.c?
msg165208 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2012-07-10 22:24
I see nothing wrong in memory_ass_sub(). In 2.7: if (destbuf + bytelen < srcbuf | srcbuf + bytelen < destbuf) /* No overlapping */ memcpy(destbuf, srcbuf, bytelen); else memmove(destbuf, srcbuf, bytelen); Other versions use similar idioms.
History
Date User Action Args
2022-04-11 14:57:32 admin set github: 59514
2012-07-10 22:24:26 skrah set status: open -> closedresolution: not a bugmessages: + stage: resolved
2012-07-10 09:17:24 skrah set messages: +
2012-07-10 00:10:54 pitrou set nosy: + skrah
2012-07-09 21:21:53 Ronny.Pfannschmidt create