emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#10070: closed (bytevector-copy! overlapping behavi


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#10070: closed (bytevector-copy! overlapping behavior is not specified)
Date: Sun, 20 Nov 2011 00:15:02 +0000

Your message dated Sun, 20 Nov 2011 01:12:57 +0100
with message-id <address@hidden>
and subject line Re: bug#10070: bytevector-copy! overlapping behavior is not 
specified
has caused the debbugs.gnu.org bug report #10070,
regarding bytevector-copy! overlapping behavior is not specified
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
10070: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10070
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: bytevector-copy! overlapping behavior is not specified Date: Thu, 17 Nov 2011 23:40:03 +0100
Hello,

Documentation for bytevector-copy! doesn't specify whether source and
target may overlap (or the order of copying), it only says:

    "Copy len bytes from source into target, starting reading from
    source-start (a positive index within source) and start writing
    at target-start."

R6RS specifies this:

   "This must work even if the memory regions for the source and the
   target overlap, i.e., the bytes at the target location after the
   copy must be equal to the bytes at the source location before the
   copy."

Looking at the code in bytevectors.c I see that the function uses
memcpy() instead of memmove(). Am I correct that in the current Guile
implementation, bytevectors must not overlap, that is, the effect of

   (bytevector-copy! source i1 source i2 len)

depends on the implementation of memcpy() in libc, and may behave
differently on different platforms?

Proposal:

1. Specify behavior of bytevector-copy! in the documentation.
2. If the current implementation is not correct, fix this ;-)

Thank you!

-- 
Dmitry Chestnykh
http://www.codingrobots.org



--- End Message ---
--- Begin Message --- Subject: Re: bug#10070: bytevector-copy! overlapping behavior is not specified Date: Sun, 20 Nov 2011 01:12:57 +0100 User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux)
Hi Dmitry,

Thanks for the report!  I fixed it by using memmove as you suggested:

  
http://git.sv.gnu.org/cgit/guile.git/commit/?id=8071964943e23700cfe1095ba0f5e3c99f590dee

Ludo’.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]