Fix tag table entry for flonum for 64-bit platforms.
authorJoe Marshall <eval.apply@gmail.com>
Sat, 18 Dec 2010 01:32:08 +0000 (17:32 -0800)
committerJoe Marshall <eval.apply@gmail.com>
Sat, 18 Dec 2010 01:32:08 +0000 (17:32 -0800)
src/runtime/generic.scm

index 39e4d2afb40f32b7e1d90ee5b70d69558166c57f..f99311375cbf74ea326ec766e53ed558608fe9cf 100644 (file)
@@ -423,14 +423,18 @@ USA.
                               ((memq object '(#!optional #!rest #!key #!aux))
                                keyword-tag)
                               (else constant-tag)))))))
-    (assign-type 'FLONUM
-                (let ((flonum-vector-tag
-                       (make-built-in-tag '(FLONUM-VECTOR))))
-                  (lambda (default-tag)
-                    (lambda (object)
-                      (if (fix:= 2 (system-vector-length object))
-                          default-tag
-                          flonum-vector-tag)))))
+
+    ;; Flonum length can change size on different architectures, so we
+    ;; measure one.
+    (let ((flonum-length (system-vector-length microcode-id/floating-epsilon)))
+      (assign-type 'FLONUM
+                  (let ((flonum-vector-tag
+                         (make-built-in-tag '(FLONUM-VECTOR))))
+                    (lambda (default-tag)
+                      (lambda (object)
+                        (if (fix:= flonum-length (system-vector-length object))
+                            default-tag
+                            flonum-vector-tag))))))
     (assign-type 'RECORD
                 (let ((dt-tag (make-built-in-tag '(DISPATCH-TAG))))
                   (lambda (default-tag)