bytevector-copy! precondition error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ikarus Scheme |
Fix Released
|
Medium
|
Abdulaziz Ghuloum |
Bug Description
i think that the right range check of bytevector-copy! is
off by one.
test case:
(let ((b (make-bytevector 6 0))
(c (make-bytevector 3 1)))
(bytevector-copy! b 0 c 1 2)
(list b c))
expected result:
(#vu8(0 0 0 0 0 0) #vu8(1 0 0))
see patch below,
regards,
rohan
=== modified file 'scheme/
--- scheme/
+++ scheme/
@@ -560,10 +560,10 @@
[(not (bytevector? dst))
(error 'bytevector-copy! "not a bytevector" dst)]
[(let ([n ($fx+ src-start k)])
- (or ($fx< n 0) ($fx>= n ($bytevector-length src))))
+ (or ($fx< n 0) ($fx> n ($bytevector-length src))))
(error 'bytevector-copy! "out of range" src-start k)]
[(let ([n ($fx+ dst-start k)])
- (or ($fx< n 0) ($fx>= n ($bytevector-length dst))))
+ (or ($fx< n 0) ($fx> n ($bytevector-length dst))))
(error 'bytevector-copy! "out of range" dst-start k)]
[(eq? src dst)
(cond
Changed in ikarus: | |
status: | Fix Committed → Fix Released |
How embarrassing :-) Fixed in revision 1156.