From 51e70805c796dd51d182134ee91ff2f1abeb476b Mon Sep 17 00:00:00 2001 From: rtoy <rtoy> Date: Thu, 14 Apr 2005 20:52:03 +0000 Subject: [PATCH] code/load.lisp: o Define EXT:INVALID-FASL condition o Signal such a condition when we try to load a fasl compiled for a different version of CMUCL. code/exports.lisp: o Export EXT:INVALID-FASL o Export a few other symbols we forgot. --- code/exports.lisp | 10 +++++++--- code/load.lisp | 21 ++++++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/code/exports.lisp b/code/exports.lisp index d8ec1a8b1..4a59667e3 100644 --- a/code/exports.lisp +++ b/code/exports.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/exports.lisp,v 1.243 2005/04/04 14:33:16 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/exports.lisp,v 1.244 2005/04/14 20:52:02 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -1352,7 +1352,9 @@ "INET-RECVFROM" "INET-SENDTO" "INET-SHUTDOWN" "SHUT-RD" "SHUT-WR" "SHUT-RDWR" - "BINARY-TEXT-STREAM")) + "BINARY-TEXT-STREAM" "READ-VECTOR" "WRITE-VECTOR" + + "INVALID-FASL")) (defpackage "STREAM" (:import-from "SYSTEM" "LISP-STREAM") @@ -1720,7 +1722,9 @@ "OS-INIT" "ALLOCATE-SYSTEM-MEMORY-AT" "ALTERNATE-GET-GLOBAL-ADDRESS" "*RUNTIME-FEATURES*" "REGISTER-LISP-FEATURE" - "REGISTER-LISP-RUNTIME-FEATURE")) + "REGISTER-LISP-RUNTIME-FEATURE" + + "BINARY-TEXT-STREAM")) (dolist (name diff --git a/code/load.lisp b/code/load.lisp index b7ffaf73e..061e3fd23 100644 --- a/code/load.lisp +++ b/code/load.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/load.lisp,v 1.89 2004/12/03 22:08:48 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/load.lisp,v 1.90 2005/04/14 20:52:03 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -16,7 +16,8 @@ (export '(load *load-verbose* *load-print* *load-truename* *load-pathname*)) (in-package "EXTENSIONS") -(export '(*load-if-source-newer* *load-source-types* *load-object-types*)) +(export '(*load-if-source-newer* *load-source-types* *load-object-types* + invalid-fasl)) (in-package "SYSTEM") (export '(foreign-symbol-address alternate-get-global-address)) @@ -80,6 +81,17 @@ ;; parameter. (defvar *skip-fasl-file-version-check* nil) +(define-condition invalid-fasl (error) + ((filename :reader invalid-fasl-pathname :initarg :file) + (fasl-version :reader invalid-fasl-version :initarg :fasl-version) + (expected-version :reader invalid-fasl-expected-version :initarg :expected-version)) + (:report + (lambda (condition stream) + (format stream "~A was compiled for fasl-file version ~X, ~ + but this is version ~X" + (invalid-fasl-pathname condition) + (invalid-fasl-version condition) + (invalid-fasl-expected-version condition))))) ;;; LOAD-FRESH-LINE -- internal. ;;; @@ -1123,9 +1135,8 @@ (when (eql imp implementation) (unless (eql version vers) (cerror "Load ~A anyway" - "~A was compiled for fasl-file version ~X, ~ - but this is version ~X" - *fasl-file* version vers)) + 'invalid-fasl :file *fasl-file* + :fasl-version version :expected-version vers)) t)) (imp-name (imp) (if (< -1 imp (length '#.c:fasl-file-implementations)) -- GitLab