1.0.3.7: Compile XEPs using the policy from the correct environment
authorJuho Snellman <jsnell@iki.fi>
Fri, 2 Mar 2007 01:33:13 +0000 (01:33 +0000)
committerJuho Snellman <jsnell@iki.fi>
Fri, 2 Mar 2007 01:33:13 +0000 (01:33 +0000)
         * Didn't matter before the fop-compiler function handling changes.

NEWS
src/compiler/main.lisp
tests/compiler-2.impure-cload.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 211e7fe..1e3b512 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@ changes in sbcl-1.0.4 relative to sbcl-1.0.3:
   * bug fix: >= and <= gave wrong results when used with NaNs.
   * bug fix: the #= and ## reader macros now interact reasonably with
     funcallable instances.
+  * bug fix: type-checks for function arguments were compiled using the
+    compiler policy settings of the wrong lexical environment (in 1.0.2
+    and 1.0.3).
 
 changes in sbcl-1.0.3 relative to sbcl-1.0.2:
   * new platform: NetBSD/PPC.  (thanks to Aymeric Vincent)
index 959fd82..4c08cd7 100644 (file)
                                   definition
                                   :source-name name)))
            (debug-name (debug-name 'tl-xep name))
+           ;; Convert the XEP using the policy of the real
+           ;; function. Otherwise the wrong policy will be used for
+           ;; deciding whether to type-check the parameters of the
+           ;; real function (via CONVERT-CALL / PROPAGATE-TO-ARGS).
+           ;; -- JES, 2007-02-27
+           (*lexenv* (make-lexenv :policy (lexenv-policy
+                                           (functional-lexenv locall-fun))))
            (fun (ir1-convert-lambda (make-xep-lambda-expression locall-fun)
                                     :source-name (or name '.anonymous.)
                                     :debug-name debug-name)))
index 8c7a3a1..f2c690e 100644 (file)
 (assert (equal (test) '(0 0 0)))
 (assert (equal (test) '(13 13 13))) ; sanity check
 
-(write-line "//compiler-2.impure.cload.lisp")
+;; Bug in 1.0.2 and 1.0.3, where the XEP was compiled with the wrong
+;; policy. (Test-case derived from code posted by alexander.ekart in
+;; comp.lang.lisp).
+
+(locally
+    (declare (optimize (safety 0)))
+  (defun bubblesort (x y)
+    (declare (type (simple-array fixnum (*)) x)
+             (type fixnum y)
+             (optimize (speed 3) (safety 3) (space 0) (debug 0)))
+    (aref x y)))
+
+(assert (raises-error? (bubblesort (make-array 10) 9)))
 
index 4bcf678..6e32b44 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.3.6"
+"1.0.3.7"