From: Richard M Kreuter Date: Wed, 4 Jun 2008 18:50:26 +0000 (+0000) Subject: 1.0.17.26: Fix regression in LOAD X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=00ca0f6bd2e4e4e4c6214466c83b2f5e7c063c65;p=sbcl.git 1.0.17.26: Fix regression in LOAD * Between 1.0.16 and 1.0.17 LOAD began to return NIL when the argument had a non-NIL type and didn't name a file. Fixed with tests. * Additionally, writing the tests exposed an odd type restriction: LOAD's IF-DOES-NOT-EXIST argument was declared as having type (MEMBER :ERROR :CREATE NIL), but the CLHS just says it's a generalized boolean. --- diff --git a/src/code/target-load.lisp b/src/code/target-load.lisp index d1dcd87..b20c4e4 100644 --- a/src/code/target-load.lisp +++ b/src/code/target-load.lisp @@ -112,13 +112,13 @@ (open pathname :if-does-not-exist (if if-does-not-exist :error nil) - :element-type '(unsigned-byte 8))) - (if if-does-not-exist - (error 'simple-file-error - :pathname pathspec - :format-control - "~@" - :format-arguments (list pathspec)))))))) + :element-type '(unsigned-byte 8)))))) + (if if-does-not-exist + (error 'simple-file-error + :pathname pathspec + :format-control + "~@" + :format-arguments (list pathspec))))) (unless stream (return-from load nil)) diff --git a/src/compiler/fndb.lisp b/src/compiler/fndb.lisp index 81fee12..5f8731d 100644 --- a/src/compiler/fndb.lisp +++ b/src/compiler/fndb.lisp @@ -1252,7 +1252,7 @@ &key (:verbose t) (:print t) - (:if-does-not-exist (member :error :create nil)) + (:if-does-not-exist t) (:external-format keyword)) t) diff --git a/tests/load.pure.lisp b/tests/load.pure.lisp index 09ef251..eed5f45 100644 --- a/tests/load.pure.lisp +++ b/tests/load.pure.lisp @@ -20,3 +20,8 @@ (load "i-am-not.lisp" :if-does-not-exist nil) (load "i-am-not.fasl" :if-does-not-exist nil) (load "i-am-not.misc-garbage" :if-does-not-exist nil) + +;;; In 1.0.17, LOAD didn't error when the file didn't exist and +;;; IF-DOES-NOT-EXIST was true. +(assert (typep (nth-value 1 (ignore-errors (load "i-am-not"))) 'file-error)) +(assert (typep (nth-value 1 (ignore-errors (load "i-am-not" :if-does-not-exist t))) 'file-error)) diff --git a/version.lisp-expr b/version.lisp-expr index f37b0a1..82ec7ef 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.17.25" +"1.0.17.26"