MULTIPLE-VALUE-CALL with too many arguments does not signal PROGRAM-ERROR
Found via https://github.com/ruricolist/serapeum/pull/109
Attempting to multiple-value-call
a (lambda (one two) ...)
with (values 1 2 3)
does not signal a program-error
.
ECL (Embeddable Common-Lisp) 21.2.1 (git:c646799145538997d84ed6d8755be7e7837eb7ef)
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2013 Juan J. Garcia-Ripoll
Copyright (C) 2018 Daniel Kochmanski
Copyright (C) 2021 Daniel Kochmanski and Marius Gerbershagen
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.
Top level in: #<process TOP-LEVEL 0x55c5648bbf80>.
> (declaim (optimize safety))
((OPTIMIZE SAFETY))
> (compile nil '(lambda () (MULTIPLE-VALUE-CALL (LAMBDA (ONE TWO) (LIST ONE TWO)) (VALUES 1 2 3))))
;;; OPTIMIZE levels: Safety=3, Space=0, Speed=3, Debug=0
;;;
;;; End of Pass 1.
#<compiled-function 0x55c565112ac0>
NIL
NIL
> (funcall *)
(1 2)
No error is signaled in safe code, which is in violation of CLHS 3.5.1.3.
The same behavior occurs in code compiled with default safety.