`(car (nthcdr ,n ,list)))))
(define-source-transform elt (seq n)
- (multiple-value-bind (context count) (possible-rest-arg-context seq)
- (if context
- `(%rest-ref ,n ,seq ,context ,count)
- (values nil t))))
+ (if (policy *lexenv* (= safety 3))
+ (values nil t)
+ (multiple-value-bind (context count) (possible-rest-arg-context seq)
+ (if context
+ `(%rest-ref ,n ,seq ,context ,count)
+ (values nil t)))))
;;; CAxR -> %REST-REF
(defun source-transform-car (list nth)
(t #'shuffle))
size type)
#'< :key #'car))))))))
+
+(with-test (:name &more-elt-index-too-large)
+ (assert (raises-error? (funcall
+ (compile nil '(lambda (&rest args)
+ (declare (optimize safety))
+ (elt args 0))))
+ sb-kernel:index-too-large-error)))