Commit dd5c372f authored by Marius Gerbershagen's avatar Marius Gerbershagen
Browse files

cmp: fix let bindings with initforms which are lists with QUOTE symbol as first element


(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.
parent 23dde962
......@@ -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))
(compile nil '(lambda () (let ((x '(quote)) (y '(quote a b c))) (list x y))))))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment