Fix `NTH` inlining type mismatch

(Olof-Joachim Frahm)

Fixes <>.

From <>.
parent 8ee53991
......@@ -5531,16 +5531,18 @@ We need more thought here.
(define-inlined-function compile-nth (form target representation)
((check-arg-count form 2))
(let ((index-form (second form))
(list-form (third form)))
(let* ((index-form (second form))
(list-form (third form))
(index-type (derive-compiler-type index-form)))
(unless (fixnum-type-p index-type)
(compile-function-call form target representation)
(return-from compile-nth))
((compile-operand index-form :int)
(compile-operand list-form nil)
(maybe-emit-clear-values index-form list-form))
(emit 'swap)
(emit-invokevirtual +lisp-object+ "NTH" '(:int) +lisp-object+))
(fix-boxing representation nil) ; FIXME use derived result type
(emit-move-from-stack target representation)))
(emit-invokevirtual +lisp-object+ "NTH" '(:int) +lisp-object+))))
(defun p2-times (form target representation)
(case (length form)
......@@ -130,3 +130,8 @@
(deftest destructuring-bind.3
(destructuring-bind (a . b) '(1) (list a b))
(1 NIL))
;; this used to fail during byte code verification
(deftest nth.inlined.1
(prog1 T (compile NIL (lambda (list) (nth (lambda ()) list))))
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