[Larceny-users] Bug in bytevector-s32-set!

Ray Racine ray.racine at comcast.net
Wed Feb 13 22:13:52 EST 2008


;; first set bytevector to -1 then read it back, did not get expected -1

(let* ((bv (make-bytevector 4 0))
      (show (lambda () (display bv)(newline))))
  (newline)
  (show)
  (bytevector-s32-set! bv 0 -1 'little)
  (show)
  (bytevector-s32-ref bv 0 'little))


#vu8(0 0 0 0)
#vu8(255 255 255 127)
2147483647

---

;; ref a little endian int from #vu8(255 255 255 255) and get -1, 
;; expected behavior

(let* ((bv (make-bytevector 4 255))
      (show (lambda () (display bv)(newline))))
  (newline)
  (show)
  (bytevector-s32-ref bv 0 'little))

#vu8(255 255 255 255)
-1

---

Ran across the above while writing a quick utility using Larceny's FFI
to IBM's MQ (mq-mgr on OS/390 mainframe) today. ?!?!? 

This weekend I'll try and get around to sending out some quick patches
on some of these little bugs I've managed to stumble across.








More information about the Larceny-users mailing list