1.0.5.44: fix reading of a suppressed #. in sb-cover
authorJuho Snellman <jsnell@iki.fi>
Wed, 9 May 2007 00:36:49 +0000 (00:36 +0000)
committerJuho Snellman <jsnell@iki.fi>
Wed, 9 May 2007 00:36:49 +0000 (00:36 +0000)
         * Suppressing of #. in the source location recording read-table was
           implemented incorrectly. (Reported by James Knight)
         * Don't silently ignore read errors.
         * Use a dummy source location map for top level forms for which
           an error was signaled, rather than NIL. Otherwise the compiler's
           and sb-cover's tlf numbering could get out of sync.

contrib/sb-cover/cover.lisp
contrib/sb-cover/test-data-2.lisp
version.lisp-expr

index bcaebfa..a4eb33b 100644 (file)
@@ -113,13 +113,16 @@ files can be specified with the EXTERNAL-FORMAT parameter."
                  (loop with map = nil
                        with form = nil
                        with eof = nil
+                       for i from 0
                        do (setf (values form map)
                                 (handler-case
                                     (read-and-record-source-map stream)
                                   (end-of-file ()
                                     (setf eof t))
-                                  (error ()
-                                    (values nil nil))))
+                                  (error (error)
+                                    (warn "Error when recording source map for toplevel form ~A:~%  ~A" i error)
+                                    (values nil
+                                            (make-hash-table)))))
                        until eof
                        when map
                        collect (cons form map)))))
@@ -427,12 +430,10 @@ The source locations are stored in SOURCE-MAP."
 (defun suppress-sharp-dot (readtable)
   (when (get-macro-character #\# readtable)
     (let ((sharp-dot (get-dispatch-macro-character #\# #\. readtable)))
-      (set-dispatch-macro-character #\# #\. (lambda (&rest args)
-                                              (let ((*read-suppress* t))
-                                                (apply sharp-dot args))
-                                              (if *read-suppress*
-                                                  (values)
-                                                  (list (gensym "#."))))
+      (set-dispatch-macro-character #\# #\.
+                                    (lambda (&rest args)
+                                      (let ((*read-suppress* t))
+                                        (apply sharp-dot args)))
                                     readtable))))
 
 (defun read-and-record-source-map (stream)
index 3ba20ce..ad9a1c1 100644 (file)
@@ -6,6 +6,11 @@
       (incf a))
     a))
 
+;;; Test for a bad interaction between *READ-SUPPRESS* and #. in
+;;; source location recording.
+(identity #+sbcl #.1
+          #+cmu #.3)
+
 ;;; This test would show that we do correct detection of non-cons
 ;;; source forms in non-PROGN-contexts. Which we don't, so this test
 ;;; is commented out.
index eaca8ad..0fb61c6 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".)
-"1.0.5.43"
+"1.0.5.44"