0.7.6.18:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 13 Aug 2002 11:45:40 +0000 (11:45 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 13 Aug 2002 11:45:40 +0000 (11:45 +0000)
SYMBOL-MACROLET fixes
... throw a COMPILER-ERROR when attempting to bind a special or
a constant with SYMBOL-MACROLET
... throw a PROGRAM-ERROR when attempting to run a form
compiled with errors
(thanks to Raymond Toy and Eric Marsden for their work on the
CMUCL side)

BUGS
src/compiler/ir1-translators.lisp
src/compiler/ir1tran.lisp
src/compiler/main.lisp
tests/compiler.impure.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index be699cd..af81ba1 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -288,10 +288,6 @@ WORKAROUND:
 
 48:
   SYMBOL-MACROLET bugs reported by Peter Van Eynde July 25, 2000:
-       a: (SYMBOL-MACROLET ((T TRUE)) ..) should probably signal
-          PROGRAM-ERROR, but SBCL accepts it instead.
-       b: SYMBOL-MACROLET should refuse to bind something which is
-          declared as a global variable, signalling PROGRAM-ERROR.
        c: SYMBOL-MACROLET should signal PROGRAM-ERROR if something
           it binds is declared SPECIAL inside.
 
@@ -623,15 +619,6 @@ WORKAROUND:
   the first time around, until regression tests are written I'm not 
   comfortable merging the patches in the CVS version of SBCL.
 
-102:
-  As reported by Arthur Lemmens sbcl-devel 2001-05-05, ANSI
-  requires that SYMBOL-MACROLET refuse to rebind special variables,
-  but SBCL doesn't do this. (Also as reported by AL in the same
-  message, SBCL depended on this nonconforming behavior to build
-  itself, because of the way that **CURRENT-SEGMENT** was implemented.
-  As of sbcl-0.7.3.x, this dependence on the nonconforming behavior
-  has been fixed, but the nonconforming behavior remains.)
-
 104:
   (DESCRIBE 'SB-ALIEN:DEF-ALIEN-TYPE) reports the macro argument list
   incorrectly:
index c8eb5e9..c06a99b 100644 (file)
          (compiler-error
           "The local symbol macro name ~S is not a symbol."
           name))
+       (let ((kind (info :variable :kind name)))
+        (when (member kind '(:special :constant))
+          (compiler-error "Attempt to bind a ~(~A~) variable with SYMBOL-MACROLET: ~S" kind name)))
        `(,name . (MACRO . ,expansion))))
    :vars
    definitions
index 579e41d..269345d 100644 (file)
                                cont
                                form
                                &optional
-                               (proxy ``(error "execution of a form compiled with errors:~% ~S"
-                                               ',,form)))
+                               (proxy ``(error 'simple-program-error
+                                         :format-control "execution of a form compiled with errors:~% ~S"
+                                         :format-arguments (list ',,form))))
                               &body body)
                              (let ((skip (gensym "SKIP")))
                                `(block ,skip
index 55be15e..88b0488 100644 (file)
           (*compiler-error-bailout*
            (lambda ()
              (convert-and-maybe-compile
-              `(error "execution of a form compiled with errors:~% ~S"
-                      ',form)
+              `(error 'simple-program-error
+                :format-control "execution of a form compiled with errors:~% ~S"
+                :format-arguments (list ',form))
               path)
              (throw 'process-toplevel-form-error-abort nil))))
 
index db08b0d..7806b50 100644 (file)
    ;; a call to prevent the other arguments from being optimized away
    (logand a1 a2 a3 a4 a5 a6 a7 a8 a9)))
 \f
+;;; BUG 48a. and b. (symbol-macrolet handling), fixed by Eric Marsden
+;;; and Raymond Toy for CMUCL, fix ported for sbcl-0.7.6.18.
+(multiple-value-bind (function warnings-p failure-p)
+    (compile nil '(lambda () (symbol-macrolet ((t nil)) t)))
+  (assert failure-p)
+  (assert (raises-error? (funcall function) program-error)))
+
+(multiple-value-bind (function warnings-p failure-p)
+    (compile nil '(lambda () (symbol-macrolet ((*standard-input* nil)) *standard-input*)))
+  (assert failure-p)
+  (assert (raises-error? (funcall function) program-error)))
+#|
+BUG 48c, not yet fixed:
+(multiple-value-bind (function warnings-p failure-p)
+    (compile nil '(lambda () (symbol-macrolet ((s nil)) (declare (special s)) s)))
+  (assert failure-p)
+  (assert (raises-error? (funcall function) program-error)))
+|#
+\f
 ;;;; tests not in the problem domain, but of the consistency of the
 ;;;; compiler machinery itself
 
index 1254533..f99bf07 100644 (file)
@@ -18,4 +18,4 @@
 ;;; for internal versions, especially for internal versions off the
 ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.7.6.17"
+"0.7.6.18"