Skip to content

Commit dad7827

Browse files
committed
Fix for upcoming work overhauling unsigned-byte arrays
Java bytes are signed, which means that accessing such a value from Lisp should be converted into a negative value between [-127 0) for bytes with a the high bit set [128 255). The in-progress changes to use unsigned-byte currently inadvertantly "fixes" direct use of such values to set places in UNSIGNED-BYTE arrays. <armedbear/abcl#625>
1 parent c753c7e commit dad7827

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

swank/abcl.lisp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@
272272
(octets (make-array len :element-type '(unsigned-byte 8))))
273273
(loop for i from 0 below len
274274
for jbyte = (java:jarray-ref jbytes i)
275-
do (setf (aref octets i) jbyte))
275+
do (setf (aref octets i)
276+
(logand jbyte #xff)))
276277
octets))
277278

278279
;;;; External formats

0 commit comments

Comments
 (0)