1.0.46.7: better error message for an invalid lambda in COMPILE, etc
authorNikodemus Siivola <nikodemus@random-state.net>
Sun, 20 Feb 2011 10:38:12 +0000 (10:38 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Sun, 20 Feb 2011 10:38:12 +0000 (10:38 +0000)
  Patch by Roman Marynchak, lp#718905.

  Make the error from NAME-LAMBDALIKE clearer.

NEWS
src/compiler/ir1-translators.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index ccb69b6..ba3c986 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ changes relative to sbcl-1.0.46:
     stack-allocated values out of their dynamic-extent. (lp#310175)
   * bug fix: attempts to use SB-SPROF for wallclock profiling on threaded
     x86-64 builds caused a type-error.
+  * bug fix: calling COMPILE with something else than a lambda-expression as the
+    second argument reports a more sensible error. (lp#718905)
 
 changes in sbcl-1.0.46 relative to sbcl-1.0.45:
   * enhancement: largefile support on Solaris.
index 347c907..74831c2 100644 (file)
@@ -473,14 +473,17 @@ Return VALUE without evaluating it."
 \f
 ;;;; FUNCTION and NAMED-LAMBDA
 (defun name-lambdalike (thing)
-  (ecase (car thing)
+  (case (car thing)
     ((named-lambda)
      (or (second thing)
          `(lambda ,(third thing))))
     ((lambda instance-lambda)
      `(lambda ,(second thing)))
     ((lambda-with-lexenv)
-     `(lambda ,(fifth thing)))))
+     `(lambda ,(fifth thing)))
+    (otherwise
+     (compiler-error "Not a valid lambda expression:~%  ~S"
+                     thing))))
 
 (defun fun-name-leaf (thing)
   (if (consp thing)
index 7e0791f..c6e6b0b 100644 (file)
@@ -20,4 +20,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.46.6"
+"1.0.46.7"