From: Juho Snellman Date: Fri, 2 Mar 2007 01:33:13 +0000 (+0000) Subject: 1.0.3.7: Compile XEPs using the policy from the correct environment X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=1a3ccb8ce23ea45adf80f356e8a116a8cf0c2ddc;p=sbcl.git 1.0.3.7: Compile XEPs using the policy from the correct environment * Didn't matter before the fop-compiler function handling changes. --- diff --git a/NEWS b/NEWS index 211e7fe..1e3b512 100644 --- 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) diff --git a/src/compiler/main.lisp b/src/compiler/main.lisp index 959fd82..4c08cd7 100644 --- a/src/compiler/main.lisp +++ b/src/compiler/main.lisp @@ -978,6 +978,13 @@ 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))) diff --git a/tests/compiler-2.impure-cload.lisp b/tests/compiler-2.impure-cload.lisp index 8c7a3a1..f2c690e 100644 --- a/tests/compiler-2.impure-cload.lisp +++ b/tests/compiler-2.impure-cload.lisp @@ -51,5 +51,17 @@ (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))) diff --git a/version.lisp-expr b/version.lisp-expr index 4bcf678..6e32b44 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"