[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] #142: move-memory! accepts negative offsets
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] #142: move-memory! accepts negative offsets |
Date: |
Tue, 08 Dec 2009 08:00:20 -0000 |
#142: move-memory! accepts negative offsets
----------------------------+-----------------------------------------------
Reporter: zbigniew | Owner:
Type: defect | Status: new
Priority: major | Milestone: 4.3.0
Component: core libraries | Version: 4.2.x
Keywords: |
----------------------------+-----------------------------------------------
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
}}}
--
Ticket URL: <http://www.irp.oist.jp/trac/chicken/ticket/142>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.
- [Chicken-janitors] #142: move-memory! accepts negative offsets,
Chicken Trac <=