emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] externals/sly e883812 11/47: Fix SLYNK-SBCL:COMPILER-NOTE-LOCAT


From: ELPA Syncer
Subject: [nongnu] externals/sly e883812 11/47: Fix SLYNK-SBCL:COMPILER-NOTE-LOCATION for non-file-backed streams
Date: Thu, 17 Dec 2020 18:57:14 -0500 (EST)

branch: externals/sly
commit e8838125f2510a365723a0da325ecf16f7c13744
Author: Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
Commit: João Távora <joaotavora@gmail.com>

    Fix SLYNK-SBCL:COMPILER-NOTE-LOCATION for non-file-backed streams
    
    Calling PATHNAME on an arbitrary stream can signal an error.
    
    * slynk/backend/sbcl.lisp (compiler-note-location): Rework.
    
    Co-authored-by: João Távora <joaotavora@gmail.com>
    Cherry-pick-from: SLIME commit 24be0b32bc36541e8d06a31edd5171c004770c22
---
 slynk/backend/sbcl.lisp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/slynk/backend/sbcl.lisp b/slynk/backend/sbcl.lisp
index 2c0015d..1914c27 100644
--- a/slynk/backend/sbcl.lisp
+++ b/slynk/backend/sbcl.lisp
@@ -580,8 +580,13 @@ information."
             (sb-c::compiler-error-context-original-source context)))
           ((typep condition 'reader-error)
            (let* ((stream (stream-error-stream condition))
-                  (file   (pathname stream)))
-             (unless (open-stream-p stream)
+                  ;; If STREAM is, for example, a STRING-INPUT-STREAM,
+                  ;; an error will be signaled since PATHNAME only
+                  ;; accepts a "stream associated with a file" which
+                  ;; is a complicated predicate and hard to test
+                  ;; portably.
+                  (file   (ignore-errors (pathname stream))))
+             (unless (and file (open-stream-p stream))
                (bailout))
              (if (compiling-from-buffer-p file)
                  ;; The stream position for e.g. "comma not inside



reply via email to

[Prev in Thread] Current Thread [Next in Thread]