1.0.23.11: Typecheck late-bound calls too
authorPaul Khuong <pvk@pvk.ca>
Tue, 2 Dec 2008 04:36:13 +0000 (04:36 +0000)
committerPaul Khuong <pvk@pvk.ca>
Tue, 2 Dec 2008 04:36:13 +0000 (04:36 +0000)
 * Ensures that the compiler can't be confused into IR2 converting
   bad `late-bound' calls like (funcall 'cons 1).

   Reported by madnificient on #lisp

src/compiler/ir1tran.lisp
tests/compiler.pure.lisp
version.lisp-expr

index e674c9d..ca8904d 100644 (file)
     (make-global-var
      :kind :global-function
      :%source-name name
-     :type (if (and (not latep)
-                    (or *derive-function-types*
-                        (member where '(:declared :defined-method))
-                        (and (member name *fun-names-in-this-file*
-                                     :test #'equal)
-                             (not (fun-lexically-notinline-p name)))))
+     :type (if (or (eq where :declared)
+                   (and (not latep)
+                        (or *derive-function-types*
+                            (eq where :defined-method)
+                            (and (not (fun-lexically-notinline-p name))
+                                 (member name *fun-names-in-this-file*
+                                         :test #'equal)))))
                (progn
                  (maybe-update-info-for-gf name)
                  (info :function :type name))
index 34aa2a0..16eeee4 100644 (file)
                                         i)
                                       i))))))
       (assert (equal '(1 2 1) (funcall fun 1))))))
+
+;;; It used to be possible to confuse the compiler into
+;;; IR2-converting such a call to CONS
+(with-test (:name :late-bound-primitive)
+  (compile nil `(lambda ()
+                  (funcall 'cons 1))))
index d305c63..a1aa720 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.23.10"
+"1.0.23.11"