From: Christophe Rhodes Date: Wed, 17 Nov 2004 14:24:41 +0000 (+0000) Subject: 0.8.16.42: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e86c7368eb115287ec44672390f790d54b5df940;p=sbcl.git 0.8.16.42: Commit patch from vja (sbcl-help 2004-11-17) for unit enumerations --- diff --git a/NEWS b/NEWS index 45c3c84..4ff5f42 100644 --- 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 diff --git a/src/code/host-alieneval.lisp b/src/code/host-alieneval.lisp index bc0100b..bd3ad14 100644 --- a/src/code/host-alieneval.lisp +++ b/src/code/host-alieneval.lisp @@ -672,7 +672,7 @@ ;; 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))))) diff --git a/tests/alien.impure.lisp b/tests/alien.impure.lisp index c1c43de..536acf3 100644 --- a/tests/alien.impure.lisp +++ b/tests/alien.impure.lisp @@ -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) diff --git a/version.lisp-expr b/version.lisp-expr index e78f60f..5ea4bd9 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"