1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-19 03:00:25 +02:00

Fix size measurement in bytevector_large_set

* libguile/bytevectors.c (bytevector_large_set): Fix computation of
  value size in words.
* test-suite/tests/bytevectors.test: Add test.

Thanks to Ben Rocer <fleabyte@mail.com> for the bug report and fix.
This commit is contained in:
Andy Wingo 2016-06-20 17:11:59 +02:00
parent 0a3ea0586d
commit b77642dff2
2 changed files with 9 additions and 4 deletions

View file

@ -345,7 +345,11 @@
(let ((b (make-bytevector 8)))
(bytevector-s64-set! b 0 -1 (endianness big))
(bytevector-u64-set! b 0 0 (endianness big))
(= 0 (bytevector-u64-ref b 0 (endianness big))))))
(= 0 (bytevector-u64-ref b 0 (endianness big)))))
(pass-if-exception "bignum out of range"
exception:out-of-range
(bytevector-u64-set! (make-bytevector 8) 0 (expt 2 64) (endianness big))))
(with-test-prefix/c&e "2.8 Operations on IEEE-754 Representations"