Summary

move-memory! accepts negative offsets

Metadata

Description

And will clobber memory. It does detect the error when the offsets are too large though.

 (define b (string->blob (make-string 10 #\nul)))
 (move-memory! "foo" b 3 0 7)      ; ok
 ,d b
 blob of size 10:
    0: 00 00 00 00 00 00 00 66 6f 6f      .......foo
 
 (move-memory! "foo" b 3 0 8)      ; error (out of range)
 (move-memory! "xyz" b 3 -1 0)     ; succeeds
 ,d b
 blob of size 10:
    0: 42 78 79 00 00 00 00 66 6f 6f      Byz....foo
 
 (move-memory! "xyz" b 3 0 -1)     ; succeeds
 ,d b
 unknown object

Changes and comments

[2009-12-10 07:46:29 UTC] felix changed status from new to accepted

[2009-12-10 07:46:29 UTC] felix set owner to felix

[2009-12-10 10:00:41 UTC] felix changed status from accepted to closed

[2009-12-10 10:00:41 UTC] felix set resolution to fixed

[2009-12-10 10:00:41 UTC] felix wrote:

Fixed in 72be4d4334280a8bcd83a91253295fb8e32debd7 (master)

[2010-03-11 10:33:12 UTC] Milestone 4.3.0 deleted