X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fdebug-dump.lisp;h=19f6a0f74bfd8e4a8c5252ee8900890bd3629654;hb=77ab3779bb218e5c3080304fddefb3956b209547;hp=7d4d71cf03b1f301b2ac726dc4fa260c58bc3c42;hpb=34dd23563d2f5cf05c72b971da0d0b065a09bf2a;p=sbcl.git diff --git a/src/compiler/debug-dump.lisp b/src/compiler/debug-dump.lisp index 7d4d71c..19f6a0f 100644 --- a/src/compiler/debug-dump.lisp +++ b/src/compiler/debug-dump.lisp @@ -277,7 +277,8 @@ ;;; a vector whose element size is an integer multiple of output byte ;;; size. (defun coerce-to-smallest-eltype (seq) - (let ((maxoid #-sb-xc-host 0 + (let ((maxoid ;; It's probably better to avoid (UNSIGNED-BYTE 0). + #-sb-xc-host 1 ;; An initial value of 255 prevents us from ;; specializing the array to anything smaller than ;; (UNSIGNED-BYTE 8), which keeps the cross-compiler's @@ -294,7 +295,17 @@ (frob i)) (dovector (i seq) (frob i))) - (coerce seq `(simple-array (integer 0 ,maxoid) (*)))))) + (let ((specializer `(unsigned-byte ,(integer-length maxoid)))) + ;; cross-compilers beware! It would be possible for the + ;; upgraded-array-element-type of (UNSIGNED-BYTE 15) to be + ;; (SIGNED-BYTE 16), and this is completely valid by + ;; ANSI. However, the cross-compiler doesn't know how to dump + ;; SIGNED-BYTE arrays, so better make it break now if it ever + ;; will: + #+sb-xc-host + (aver (subtypep (upgraded-array-element-type specializer) + 'unsigned-byte)) + (coerce seq `(simple-array ,specializer (*))))))) ;;;; variables