1.0.32.12: Fix slot-value on specialized parameters in SVUC methods
[sbcl.git] / src / code / array.lisp
index 4cd1b08..b46b1ff 100644 (file)
@@ -96,6 +96,8 @@
      (values #.sb!vm:simple-bit-vector-widetag 1))
     ;; OK, we have to wade into SUBTYPEPing after all.
     (t
+     (unless *type-system-initialized*
+       (bug "SUBTYPEP dispatch for MAKE-ARRAY before the type system is ready"))
      #.`(pick-vector-type type
          ,@(map 'list
                 (lambda (saetp)
@@ -328,17 +330,17 @@ of specialized arrays is supported."
 ;;; vectors or not simple.
 (macrolet ((def (name table-name)
              `(progn
-                (defglobal ,table-name (make-array ,sb!vm:widetag-mask))
+                (defglobal ,table-name (make-array ,(1+ sb!vm:widetag-mask)))
                 (defmacro ,name (array-var)
                   `(the function
                      (let ((tag 0))
                        (when (sb!vm::%other-pointer-p ,array-var)
                          (setf tag (%other-pointer-widetag ,array-var)))
                        (svref ,',table-name tag)))))))
-  (def !find-data-vector-setter **data-vector-setters**)
-  (def !find-data-vector-setter/check-bounds **data-vector-setters/check-bounds**)
-  (def !find-data-vector-reffer **data-vector-reffers**)
-  (def !find-data-vector-reffer/check-bounds **data-vector-reffers/check-bounds**))
+  (def !find-data-vector-setter %%data-vector-setters%%)
+  (def !find-data-vector-setter/check-bounds %%data-vector-setters/check-bounds%%)
+  (def !find-data-vector-reffer %%data-vector-reffers%%)
+  (def !find-data-vector-reffer/check-bounds %%data-vector-reffers/check-bounds%%))
 
 (macrolet ((%ref (accessor-getter extra-params)
              `(funcall (,accessor-getter array) array index ,@extra-params))
@@ -428,7 +430,10 @@ of specialized arrays is supported."
                   new-value)))
            (define-reffers (symbol deffer check-form slow-path)
              `(progn
-                (setf ,symbol (make-array sb!vm::widetag-mask
+                ;; FIXME/KLUDGE: can't just FILL here, because genesis doesn't
+                ;; preserve the binding, so re-initiaize as NS doesn't have
+                ;; the energy to figure out to change that right now.
+                (setf ,symbol (make-array (1+ sb!vm::widetag-mask)
                                           :initial-element #'hairy-ref-error))
                 ,@(loop for widetag in '(sb!vm:complex-vector-widetag
                                          sb!vm:complex-vector-nil-widetag
@@ -443,16 +448,16 @@ of specialized arrays is supported."
                         collect `(setf (svref ,symbol ,widetag)
                                        (,deffer ,saetp ,check-form))))))
   (defun !hairy-data-vector-reffer-init ()
-    (define-reffers **data-vector-reffers** define-reffer
+    (define-reffers %%data-vector-reffers%% define-reffer
       (progn)
       #'slow-hairy-data-vector-ref)
-    (define-reffers **data-vector-setters** define-setter
+    (define-reffers %%data-vector-setters%% define-setter
       (progn)
       #'slow-hairy-data-vector-set)
-    (define-reffers **data-vector-reffers/check-bounds** define-reffer
+    (define-reffers %%data-vector-reffers/check-bounds%% define-reffer
       (%check-bound vector (length vector))
       #'slow-hairy-data-vector-ref/check-bounds)
-    (define-reffers **data-vector-setters/check-bounds** define-setter
+    (define-reffers %%data-vector-setters/check-bounds%% define-setter
       (%check-bound vector (length vector))
       #'slow-hairy-data-vector-set/check-bounds)))
 
@@ -528,7 +533,7 @@ of specialized arrays is supported."
 
 (defun array-in-bounds-p (array &rest subscripts)
   #!+sb-doc
-  "Return T if the SUBSCIPTS are in bounds for the ARRAY, NIL otherwise."
+  "Return T if the SUBSCRIPTS are in bounds for the ARRAY, NIL otherwise."
   (if (%array-row-major-index array subscripts nil)
       t))