The special declarations of &aux variables were ignored. Example:

(defun f1 (x &aux y)
  (declare (special y))
  (list (f2 x) y))

(defun f2 (x)
  (declare (special y))
  (setq y 'y)
  (list x y))
This commit is contained in:
jjgarcia 2005-05-18 12:13:57 +00:00
parent c3d1b0353f
commit 127d575ade
2 changed files with 6 additions and 4 deletions

View file

@ -269,11 +269,12 @@
(warn "The variable name ~s is not a symbol." var))))
(defun c1body (body doc-p &aux
(all-declarations nil)
(ss nil) ; special vars
(is nil) ; ignored vars
(ts nil) ; typed vars (var . type)
(others nil) ; all other vars
doc form)
doc form)
(loop
(when (endp body) (return))
(setq form (cmp-macroexpand (car body)))
@ -282,6 +283,7 @@
(when (or (null doc-p) (endp (cdr body)) doc) (return))
(setq doc form))
((and (consp form) (eq (car form) 'DECLARE))
(push form all-declarations)
(dolist (decl (cdr form))
(cmpck (or (not (consp decl)) (not (symbolp (car decl))))
"The declaration ~s is illegal." (cons form decl))
@ -343,7 +345,7 @@
(t (return)))
(pop body)
)
(values body ss ts is others doc)
(values body ss ts is others doc all-declarations)
)
(defun c1add-declarations (decls &aux (dl nil))

View file

@ -134,7 +134,7 @@
(cmpck (endp lambda-expr)
"The lambda expression ~s is illegal." (cons 'LAMBDA lambda-expr))
(multiple-value-setq (body ss ts is other-decls doc)
(multiple-value-setq (body ss ts is other-decls doc all-declarations)
(c1body (cdr lambda-expr) t))
(when block-it (setq body (list (cons 'BLOCK (cons block-name body)))))
@ -193,7 +193,7 @@
(let ((var (first specs))
(init (second specs)))
(setq let (cons (if init (list var init) var) let))))
(setq body `((let* ,(nreverse let) (declare ,@other-decls) ,@body)))))
(setq body `((let* ,(nreverse let) ,@all-declarations ,@body)))))
(let ((new-vars (ldiff *vars* old-vars)))
(setq body (c1decl-body other-decls body))