From: stassats <sta...@us...> - 2013-05-31 12:34:46
|
The branch "master" has been updated in SBCL: via 8a19ff566e3a1a43cb3b2d11d2781a1c89981f43 (commit) from 2378406d6eda78090dfe05e372438495aeace5e0 (commit) - Log ----------------------------------------------------------------- commit 8a19ff566e3a1a43cb3b2d11d2781a1c89981f43 Author: Stas Boukarev <sta...@gm...> Date: Fri May 31 16:27:11 2013 +0400 Fix a regression in APPEND type derivation. Do not just test the arguments for validity by being subtypes or supertypes of LIST, but also if it's a subytpe of NULL, since ATOM or SYMBOL won't satisfy the LIST tests. Regression since f32ee7d.."Better type derivation for APPEND, NCONC, LIST.", reported by Eric Marsden. --- src/compiler/srctran.lisp | 5 ++++- tests/compiler.pure.lisp | 2 ++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp index ef9de86..80338ea 100644 --- a/src/compiler/srctran.lisp +++ b/src/compiler/srctran.lisp @@ -178,7 +178,10 @@ do (let ((lvar-type (lvar-type arg))) (unless (or (csubtypep list-type lvar-type) - (csubtypep lvar-type list-type)) + (csubtypep lvar-type list-type) + ;; Check for NIL specifically, because + ;; SYMBOL or ATOM won't satisfie the above + (csubtypep null-type lvar-type)) (assert-lvar-type arg list-type (lexenv-policy *lexenv*)) (return *empty-type*)))) diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 3e949b3..f30c809 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -4408,6 +4408,8 @@ (lambda (x) (append x (cons 1 2))) cons (lambda (x y) (append x (cons 1 2) y)) cons (lambda (x y) (nconc x (the list y) x)) t + (lambda (x y) (nconc (the atom x) y)) t + (lambda (x y) (nconc (the (or null (eql 10)) x) y)) t (lambda (x y) (print (length y)) (append x y)) sequence))) (loop for (function result-type) on test-cases by #'cddr do (assert (equal (car (cdaddr (sb-kernel:%simple-fun-type ----------------------------------------------------------------------- hooks/post-receive -- SBCL |