0.8.16.42:
authorChristophe Rhodes <csr21@cam.ac.uk>
Wed, 17 Nov 2004 14:24:41 +0000 (14:24 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Wed, 17 Nov 2004 14:24:41 +0000 (14:24 +0000)
Commit patch from vja (sbcl-help 2004-11-17) for unit enumerations

NEWS
src/code/host-alieneval.lisp
tests/alien.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 45c3c84..4ff5f42 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -46,6 +46,8 @@ changes in sbcl-0.8.17 relative to sbcl-0.8.16:
   * bug fix: EQUAL compiler optimizations is less aggressive on
     strings which can potentially compare true despite having distinct
     specialized array element types.
+  * bug fix: unit enumerations can be defined without dividing by
+    zero.  (thanks to Vincent Arkesteijn)
   * FORMAT compile-time argument count checking has been enhanced.
     (report from Bruno Haible for CMUCL)
   * a partial workaround for the bug 262: the compiler does not try to
index bc0100b..bd3ad14 100644 (file)
        ;; If range is at least 20% dense, use vector mapping. Crossover
        ;; point solely on basis of space would be 25%. Vector mapping
        ;; is always faster, so give the benefit of the doubt.
-       ((< 0.2 (/ (float (length from-alist)) (float (- max min))))
+       ((< 0.2 (/ (float (length from-alist)) (float (1+ (- max min)))))
        ;; If offset is small and ignorable, ignore it to save time.
        (when (< 0 min 10) (setq min 0))
        (let ((to (make-array (1+ (- max min)))))
index c1c43de..536acf3 100644 (file)
@@ -90,5 +90,9 @@
     (delete-file (compile-file-pathname fname))
     (delete-file fname)))
 
+;;; enumerations with only one enum resulted in division-by-zero
+;;; reported on sbcl-help 2004-11-16 by John Morrison
+(define-alien-type enum.1 (enum nil (:val0 0)))
+
 ;;; success
 (quit :unix-status 104)
index e78f60f..5ea4bd9 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.16.41"
+"0.8.16.42"