Skip to content

Commit

Permalink
0.7.6.18:
Browse files Browse the repository at this point in the history
	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)
  • Loading branch information
csrhodes committed Aug 13, 2002
1 parent 073501e commit f399a6f
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 18 deletions.
13 changes: 0 additions & 13 deletions BUGS
Expand Up @@ -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.

Expand Down Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions src/compiler/ir1-translators.lisp
Expand Up @@ -302,6 +302,9 @@
(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
Expand Down
5 changes: 3 additions & 2 deletions src/compiler/ir1tran.lisp
Expand Up @@ -428,8 +428,9 @@
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
Expand Down
5 changes: 3 additions & 2 deletions src/compiler/main.lisp
Expand Up @@ -1000,8 +1000,9 @@
(*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))))

Expand Down
19 changes: 19 additions & 0 deletions tests/compiler.impure.lisp
Expand Up @@ -160,6 +160,25 @@
;; a call to prevent the other arguments from being optimized away
(logand a1 a2 a3 a4 a5 a6 a7 a8 a9)))

;;; 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)))
|#

;;;; tests not in the problem domain, but of the consistency of the
;;;; compiler machinery itself

Expand Down
2 changes: 1 addition & 1 deletion version.lisp-expr
Expand Up @@ -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"

0 comments on commit f399a6f

Please sign in to comment.