Skip to content
Snippets Groups Projects
Commit 51e70805 authored by rtoy's avatar rtoy
Browse files

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.
parent 5db20042
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (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 @@ ...@@ -1352,7 +1352,9 @@
"INET-RECVFROM" "INET-SENDTO" "INET-SHUTDOWN" "INET-RECVFROM" "INET-SENDTO" "INET-SHUTDOWN"
"SHUT-RD" "SHUT-WR" "SHUT-RDWR" "SHUT-RD" "SHUT-WR" "SHUT-RDWR"
"BINARY-TEXT-STREAM")) "BINARY-TEXT-STREAM" "READ-VECTOR" "WRITE-VECTOR"
"INVALID-FASL"))
(defpackage "STREAM" (defpackage "STREAM"
(:import-from "SYSTEM" "LISP-STREAM") (:import-from "SYSTEM" "LISP-STREAM")
...@@ -1720,7 +1722,9 @@ ...@@ -1720,7 +1722,9 @@
"OS-INIT" "ALLOCATE-SYSTEM-MEMORY-AT" "OS-INIT" "ALLOCATE-SYSTEM-MEMORY-AT"
"ALTERNATE-GET-GLOBAL-ADDRESS" "ALTERNATE-GET-GLOBAL-ADDRESS"
"*RUNTIME-FEATURES*" "REGISTER-LISP-FEATURE" "*RUNTIME-FEATURES*" "REGISTER-LISP-FEATURE"
"REGISTER-LISP-RUNTIME-FEATURE")) "REGISTER-LISP-RUNTIME-FEATURE"
"BINARY-TEXT-STREAM"))
(dolist (dolist
(name (name
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (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 @@ ...@@ -16,7 +16,8 @@
(export '(load *load-verbose* *load-print* *load-truename* *load-pathname*)) (export '(load *load-verbose* *load-print* *load-truename* *load-pathname*))
(in-package "EXTENSIONS") (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") (in-package "SYSTEM")
(export '(foreign-symbol-address alternate-get-global-address)) (export '(foreign-symbol-address alternate-get-global-address))
...@@ -80,6 +81,17 @@ ...@@ -80,6 +81,17 @@
;; parameter. ;; parameter.
(defvar *skip-fasl-file-version-check* nil) (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. ;;; LOAD-FRESH-LINE -- internal.
;;; ;;;
...@@ -1123,9 +1135,8 @@ ...@@ -1123,9 +1135,8 @@
(when (eql imp implementation) (when (eql imp implementation)
(unless (eql version vers) (unless (eql version vers)
(cerror "Load ~A anyway" (cerror "Load ~A anyway"
"~A was compiled for fasl-file version ~X, ~ 'invalid-fasl :file *fasl-file*
but this is version ~X" :fasl-version version :expected-version vers))
*fasl-file* version vers))
t)) t))
(imp-name (imp) (imp-name (imp)
(if (< -1 imp (length '#.c:fasl-file-implementations)) (if (< -1 imp (length '#.c:fasl-file-implementations))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment