(funcall (lambda (&rest args) (car args))) => garbage,
because &more accessing didn't check bounds.
Fixes lp#1154946.
* bug fix: Better error messages for package operations (lp#1154776)
* bug fix: delete-package on a nonexistent package should signal a cerror.
(regression since 1.0.37.44).
+ * bug fix: accessing &MORE (stack allocated &REST) arguments checks bounds.
+ (lp#1154946)
changes in sbcl-1.1.5 relative to sbcl-1.1.4:
* minor incompatible change: SB-SPROF:WITH-PROFILING no longer loops
(deftransform %rest-ref ((n list context count))
(cond ((rest-var-more-context-ok list)
- `(%more-arg context n))
+ `(and (< (the index n) count)
+ (%more-arg context n)))
((and (constant-lvar-p n) (zerop (lvar-value n)))
`(car list))
(t
(assert (every (lambda (x)
(sb-sys:sap= x (sb-sys:int-sap (+ 16 (ash 1 (1- width))))))
(funcall f (sb-sys:int-sap (ash 1 (1- width))))))))
+
+(with-test (:name :&more-bounds)
+ ;; lp#1154946
+ (assert (not (funcall (compile nil '(lambda (&rest args) (car args))))))
+ (assert (not (funcall (compile nil '(lambda (&rest args) (nth 6 args))))))
+ (assert (not (funcall (compile nil '(lambda (&rest args) (elt args 10))))))
+ (assert (not (funcall (compile nil '(lambda (&rest args) (cadr args))))))
+ (assert (not (funcall (compile nil '(lambda (&rest args) (third args)))))))