X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fload.lisp;h=9ca88ae8742b7265284a25b1932c696b54ee0ae9;hb=8eee0d3a30bf39d9f201acff28c92059fe6c3e4e;hp=1a0bceaaa98d8bf1854cb45d4c2682c6aa50b7e5;hpb=cdc0994481502b7cce9c0a62b48d4cf28965d612;p=sbcl.git diff --git a/src/code/load.lisp b/src/code/load.lisp index 1a0bcea..9ca88ae 100644 --- a/src/code/load.lisp +++ b/src/code/load.lisp @@ -20,7 +20,7 @@ ;;;; here: certainly enough that I (dan, 2003.1.22) don't want to mess ;;;; around deciding how to thread-safetify it. So we use a Big Lock. ;;;; Because this code is mutually recursive with the compiler, we use -;;;; the *big-compiler-lock* +;;;; the *world-lock*. ;;;; miscellaneous load utilities @@ -230,8 +230,8 @@ position ~A: Expected ~A, got ~A.~:@>" (invalid-fasl-stream condition) (invalid-fasl-byte-nr condition) - (invalid-fasl-byte condition) - (invalid-fasl-expected condition))))) + (invalid-fasl-expected condition) + (invalid-fasl-byte condition))))) (define-condition invalid-fasl-version (invalid-fasl) ((version :reader invalid-fasl-version :initarg :version)) @@ -290,7 +290,7 @@ (unless (= byte (char-code (schar fhsss 0))) (error 'invalid-fasl-header :stream stream - :first-byte-p t + :byte-nr 0 :byte byte :expected (char-code (schar fhsss 0)))) (do ((byte (read-byte stream) (read-byte stream)) @@ -312,26 +312,25 @@ (read-string-as-bytes stream result) result))) ;; Read and validate implementation and version. - (let* ((implementation (keywordicate (string-from-stream))) - (fasl-version (read-word-arg)) + (let ((implementation (keywordicate (string-from-stream))) + (expected-implementation +backend-fasl-file-implementation+)) + (unless (string= expected-implementation implementation) + (error 'invalid-fasl-implementation + :stream stream + :implementation implementation + :expected expected-implementation))) + (let* ((fasl-version (read-word-arg)) (sbcl-version (if (<= fasl-version 76) "1.0.11.18" (string-from-stream))) - (expected-version (sb!xc:lisp-implementation-version)) - (expected-implementation +backend-fasl-file-implementation+)) - (cond ((string/= expected-implementation implementation) - (error 'invalid-fasl-implementation - :stream stream - :implementation implementation - :expected expected-implementation)) - ((string/= expected-version sbcl-version) - (restart-case - (error 'invalid-fasl-version - :stream stream - :version sbcl-version - :expected expected-version) - (continue () - :report "Load the fasl file anyway"))))) + (expected-version (sb!xc:lisp-implementation-version))) + (unless (string= expected-version sbcl-version) + (restart-case + (error 'invalid-fasl-version + :stream stream + :version sbcl-version + :expected expected-version) + (continue () :report "Load the fasl file anyway")))) ;; Read and validate *FEATURES* which affect binary compatibility. (let ((faff-in-this-file (string-from-stream))) (unless (string= faff-in-this-file *features-affecting-fasl-format*) @@ -399,7 +398,7 @@ (when (zerop (file-length stream)) (error "attempt to load an empty FASL file:~% ~S" (namestring stream))) (maybe-announce-load stream verbose) - (sb!thread:with-recursive-lock (sb!c::*big-compiler-lock*) + (with-world-lock () (let* ((*fasl-input-stream* stream) (*fasl-symbol-buffer* (make-string 100)) (*current-fop-table* (or (pop *free-fop-tables*) (make-array 1000)))