From: Juho Snellman Date: Wed, 9 May 2007 00:36:49 +0000 (+0000) Subject: 1.0.5.44: fix reading of a suppressed #. in sb-cover X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e561daafc83baebdae5fc2779d7ea3167d3e334e;p=sbcl.git 1.0.5.44: fix reading of a suppressed #. in sb-cover * 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. --- diff --git a/contrib/sb-cover/cover.lisp b/contrib/sb-cover/cover.lisp index bcaebfa..a4eb33b 100644 --- a/contrib/sb-cover/cover.lisp +++ b/contrib/sb-cover/cover.lisp @@ -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) diff --git a/contrib/sb-cover/test-data-2.lisp b/contrib/sb-cover/test-data-2.lisp index 3ba20ce..ad9a1c1 100644 --- a/contrib/sb-cover/test-data-2.lisp +++ b/contrib/sb-cover/test-data-2.lisp @@ -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. diff --git a/version.lisp-expr b/version.lisp-expr index eaca8ad..0fb61c6 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".) -"1.0.5.43" +"1.0.5.44"