Changeset 15034


Ignore:
Timestamp:
06/03/17 04:35:20 (5 years ago)
Author:
Mark Evenson
Message:

Fix NTH inlining type mismatch
(Olof-Joachim Frahm)

Fixes <http://abcl.org/trac/ticket/316>.

From <https://github.com/Ferada/abcl/commit/4b6cbb1a917fbd33d949da131b57c93641fafbd6>.

Location:
trunk/abcl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r14951 r15034  
    55325532(define-inlined-function compile-nth (form target representation)
    55335533  ((check-arg-count form 2))
    5534   (let ((index-form (second form))
    5535         (list-form (third form)))
     5534  (let* ((index-form (second form))
     5535         (list-form (third form))
     5536         (index-type (derive-compiler-type index-form)))
     5537    (unless (fixnum-type-p index-type)
     5538      (compile-function-call form target representation)
     5539      (return-from compile-nth))
    55365540    (with-operand-accumulation
    55375541        ((compile-operand index-form :int)
     
    55395543         (maybe-emit-clear-values index-form list-form))
    55405544      (emit 'swap)
    5541       (emit-invokevirtual +lisp-object+ "NTH" '(:int) +lisp-object+))
    5542     (fix-boxing representation nil) ; FIXME use derived result type
    5543     (emit-move-from-stack target representation)))
     5545      (emit-invokevirtual +lisp-object+ "NTH" '(:int) +lisp-object+))))
    55445546
    55455547(defun p2-times (form target representation)
  • trunk/abcl/test/lisp/abcl/misc-tests.lisp

    r15004 r15034  
    131131  (destructuring-bind (a . b) '(1) (list a b))
    132132  (1 NIL))
     133
     134;; this used to fail during byte code verification
     135(deftest nth.inlined.1
     136    (prog1 T (compile NIL (lambda (list) (nth (lambda ()) list))))
     137  T)
Note: See TracChangeset for help on using the changeset viewer.