cmp: correctly handle unused special &rest variables

Even when the variable is not used, we still have to do the binding.
This commit is contained in:
Marius Gerbershagen 2020-03-21 11:54:40 +01:00
parent 14d46da134
commit 91d251a7ba

View file

@ -430,7 +430,8 @@ The function thus belongs to the type of functions that ecl_make_cfun accepts."
when (unboxed var)
do (setf (var-loc var) (wt-decl var)))
;; dont create rest or varargs if not used
(when (and rest (< (var-ref rest) 1))
(when (and rest (< (var-ref rest) 1)
(not (eq (var-kind rest) 'SPECIAL)))
(setq rest nil
varargs (or optionals key-flag allow-other-keys)))
;; Declare &optional variables