projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
10f0f3f
)
Fix thinko as reported by Patric Jonsson.
author
Chris Hanson
<org/chris-hanson/cph>
Mon, 30 Apr 2018 17:55:24 +0000
(10:55 -0700)
committer
Chris Hanson
<org/chris-hanson/cph>
Mon, 30 Apr 2018 17:55:24 +0000
(10:55 -0700)
Incorrectly computed length of result in exact-nonnegative-integer->bytevector.
src/runtime/bytevector.scm
patch
|
blob
|
history
diff --git
a/src/runtime/bytevector.scm
b/src/runtime/bytevector.scm
index da6aefeab13e195ea16151de054cc2a55a8029b9..6aa8efbb9de38233fd7c6b732c18b9ca333e744c 100644
(file)
--- a/
src/runtime/bytevector.scm
+++ b/
src/runtime/bytevector.scm
@@
-467,7
+467,7
@@
USA.
(define (exact-nonnegative-integer->bytevector n)
(guarantee exact-nonnegative-integer? n
'exact-nonnegative-integer->bytevector)
- (let* ((n-bytes (quotient (+ (integer-length-in-bits n)
#xFF) #x100
))
+ (let* ((n-bytes (quotient (+ (integer-length-in-bits n)
7) 8
))
(result (make-bytevector n-bytes)))
(do ((n n (quotient n #x100))
(i 0 (fix:+ i 1)))