bytevector-copy! precondition error

Bug #173170 reported by rd
2
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/ikarus.bytevectors.ss'
--- scheme/ikarus.bytevectors.ss 2007-11-12 04:29:54 +0000
+++ scheme/ikarus.bytevectors.ss 2007-12-01 00:44:57 +0000
@@ -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

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

How embarrassing :-) Fixed in revision 1156.

Changed in ikarus:
assignee: nobody → aghuloum
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

This bug report is about to be closed as the fix comitted
previously will be incorporated in the next 0.0.3 release of
Ikarus Scheme, scheduled for January 31, 2008. A release
candidate tarball is available for download from:
http://www.cs.indiana.edu/~aghuloum/ikarus/ikarus-0.0.3-rc1.tar.gz
Please do test it if you have the time and report any issues
you might encounter. Thank you very much for your support.
(Sorry for the duplicates; I'm updating every open bug.)

Changed in ikarus:
milestone: none → 0.0.3
Changed in ikarus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.