mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-28 07:22:27 -08:00
cmp: fix let bindings with initforms which are lists with QUOTE symbol as first element
Example: (let ((x '(quote ...))) ...) We really have to quote the value in all cases, si::maybe-quote would strip away one level of quotation leaving only the equivalent of (let ((x (quote ...))) ...) which of course is incorrect.
This commit is contained in:
parent
23dde9625d
commit
dd5c372ff8
2 changed files with 10 additions and 1 deletions
|
|
@ -108,7 +108,7 @@
|
|||
(multiple-value-bind (constantp value)
|
||||
(c1form-constant-p init)
|
||||
(when constantp
|
||||
(cmp-env-register-symbol-macro name (si::maybe-quote value))
|
||||
(cmp-env-register-symbol-macro name `',value)
|
||||
(setf var nil))))
|
||||
(when var
|
||||
(push var vars)
|
||||
|
|
|
|||
|
|
@ -2037,3 +2037,12 @@
|
|||
'((1 1 nil nil nil)
|
||||
(1 2 nil nil nil)
|
||||
(1 2 (:d 3) 3 3)))))
|
||||
|
||||
;;; Date 2021-03-30
|
||||
;;; Description
|
||||
;;;
|
||||
;;; let bindings of lists like '(quote ...) were miscompiled
|
||||
(test cmp.0087.let-list-containing-quote
|
||||
(is (equal '((quote) (quote a b c))
|
||||
(funcall
|
||||
(compile nil '(lambda () (let ((x '(quote)) (y '(quote a b c))) (list x y))))))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue