- (let* ((length (read-arg 4))
- (result (make-string length)))
- (read-string-as-bytes stream result)
- result)))
- ;; Read and validate implementation and version.
- (let* ((implementation (keywordicate (string-from-stream)))
- ;; FIXME: The logic above to read a keyword from the fasl file
- ;; could probably be shared with the read-a-keyword fop.
- (version (read-arg 4)))
- (flet ((check-version (variant
- possible-implementation
- needed-version)
- (when (string= possible-implementation implementation)
- (or (= version needed-version)
- (error 'invalid-fasl-version
- ;; :error :wrong-version
- :stream stream
- :variant variant
- :version version
- :expected needed-version)))))
- (or (check-version "native code"
- +backend-fasl-file-implementation+
- +fasl-file-version+)
- (error 'invalid-fasl-implementation
- :stream stream
- :implementation implementation
- :expected +backend-fasl-file-implementation+))))
- ;; 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*)
- (error 'invalid-fasl-features
- :stream stream
- :potential-features *features-potentially-affecting-fasl-format*
- :expected *features-affecting-fasl-format*
- :features faff-in-this-file)))
- ;; success
- t))))
+ (let* ((length (read-unsigned-byte-32-arg))
+ (result (make-string length)))
+ (read-string-as-bytes stream result)
+ result)))
+ ;; Read and validate implementation and version.
+ (let* ((implementation (keywordicate (string-from-stream)))
+ ;; FIXME: The logic above to read a keyword from the fasl file
+ ;; could probably be shared with the read-a-keyword fop.
+ (version (read-word-arg)))
+ (flet ((check-version (variant
+ possible-implementation
+ needed-version)
+ (when (string= possible-implementation implementation)
+ (or (= version needed-version)
+ (error 'invalid-fasl-version
+ ;; :error :wrong-version
+ :stream stream
+ :variant variant
+ :version version
+ :expected needed-version)))))
+ (or (check-version "native code"
+ +backend-fasl-file-implementation+
+ +fasl-file-version+)
+ (error 'invalid-fasl-implementation
+ :stream stream
+ :implementation implementation
+ :expected +backend-fasl-file-implementation+))))
+ ;; 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*)
+ (error 'invalid-fasl-features
+ :stream stream
+ :potential-features *features-potentially-affecting-fasl-format*
+ :expected *features-affecting-fasl-format*
+ :features faff-in-this-file)))
+ ;; success
+ t))))