0.9.2.52: fix some bugs relating to universal times outside Unix's representable...
authorBrian Mastenbrook <bmastenb@cs.indiana.edu>
Thu, 21 Jul 2005 02:36:23 +0000 (02:36 +0000)
committerBrian Mastenbrook <bmastenb@cs.indiana.edu>
Thu, 21 Jul 2005 02:36:23 +0000 (02:36 +0000)
NEWS
src/code/time.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 356018a..536dd66 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,7 @@ changes in sbcl-0.9.3 relative to sbcl-0.9.2:
        an inappropriate moment
     ** bug fix: run-program is now thread safe(r)
     ** bug fix: inner with-recursive-lock no longer releases the mutex
+  * fixed a bug in (DECODE-UNIVERSAL-TIME 0) (reported by Paul Dietz)
   * fixed some bugs revealed by Paul Dietz' test suite:
     ** TYPE-ERRORs from signalled by COERCE now have DATUM and
        EXPECTED-TYPE slots filled.
@@ -41,6 +42,8 @@ changes in sbcl-0.9.3 relative to sbcl-0.9.2:
        values form.
     ** MAKE-CONDITION accepts classes as type-designators.
     ** COMPILE may never return NIL.
+    ** ENCODE-UNIVERSAL-TIME now guards against times out of Unix's
+       range before calling Unix time functions
 
 changes in sbcl-0.9.2 relative to sbcl-0.9.1:
   * numerous signal handling fixes to increase stability
index 52c3059..dd8d3a5 100644 (file)
 
 (defun truncate-to-unix-range (utime)
   (let ((unix-time (- utime unix-to-universal-time)))
-    (if (< unix-time (ash 1 31))
+    (if (and (>= unix-time 0)
+             (< unix-time (ash 1 31)))
         unix-time
         (multiple-value-bind (year offset) (years-since-mar-2000 utime)
           (declare (ignore year))
                                   (leap-years-before fake-year)))))))
             (let* ((secwest-guess
                     (sb!unix::unix-get-seconds-west
-                     (- (* hours 60 60) unix-to-universal-time)))
+                     (truncate-to-unix-range (* hours 60 60))))
                    (guess (+ second (* 60 (+ minute (* hours 60)))
                              secwest-guess))
                    (secwest
                     (sb!unix::unix-get-seconds-west
-                     (- guess unix-to-universal-time))))
+                     (truncate-to-unix-range guess))))
               (+ guess (- secwest secwest-guess)))))))
 \f
 ;;;; TIME
index 4de0235..4c53cf1 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.9.2.51"
+"0.9.2.52"