0.8.21.21: fix & share EXTERN-ALIEN-NAME logic (fixes bug #373)
[sbcl.git] / src / compiler / generic / genesis.lisp
index fd4cbfc..ba452c3 100644 (file)
@@ -673,7 +673,7 @@ core and return a descriptor to it."
         (ecase sb!c:*backend-byte-order*
           (:little-endian
            (write-wordindexed address index low-bits)
-           (write-wordindexed address index high-bits))
+           (write-wordindexed address (1+ index) high-bits))
           (:big-endian
            (write-wordindexed address index high-bits)
            (write-wordindexed address (1+ index) low-bits)))))
@@ -690,6 +690,11 @@ core and return a descriptor to it."
 (defun float-to-core (x)
   (etypecase x
     (single-float
+     ;; 64-bit platforms have immediate single-floats.
+     #!+#.(cl:if (cl:= sb!vm:n-word-bits 64) '(and) '(or))
+     (make-random-descriptor (logior (ash (single-float-bits x) 32)
+                                    sb!vm::single-float-widetag))
+     #!-#.(cl:if (cl:= sb!vm:n-word-bits 64) '(and) '(or))
      (let ((des (allocate-unboxed-object *dynamic*
                                         sb!vm:n-word-bits
                                         (1- sb!vm:single-float-size)
@@ -1249,7 +1254,9 @@ core and return a descriptor to it."
     (frob sub-gc)
     (frob internal-error)
     (frob sb!kernel::control-stack-exhausted-error)
-    (frob sb!kernel::undefined-alien-error)
+    (frob sb!kernel::undefined-alien-variable-error)
+    (frob sb!kernel::undefined-alien-function-error)
+    (frob sb!kernel::memory-fault-error)
     (frob sb!di::handle-breakpoint)
     (frob sb!di::handle-fun-end-breakpoint)
     (frob sb!thread::handle-thread-exit))
@@ -1467,7 +1474,7 @@ core and return a descriptor to it."
                               sb!vm:fdefn-raw-addr-slot
                               (make-random-descriptor
                                (cold-foreign-symbol-address-as-integer
-                                (sb!vm:extern-alien-name "undefined_tramp")))))
+                                "undefined_tramp"))))
          fdefn))))
 
 ;;; Handle the at-cold-init-time, fset-for-static-linkage operation
@@ -1494,7 +1501,7 @@ core and return a descriptor to it."
                          (/show0 "/static-fset (closure)")
                          (make-random-descriptor
                           (cold-foreign-symbol-address-as-integer
-                           (sb!vm:extern-alien-name "closure_tramp"))))))
+                           "closure_tramp")))))
     fdefn))
 
 (defun initialize-static-fns ()