branch: externals/sly
commit e8838125f2510a365723a0da325ecf16f7c13744
Author: Jan Moringen <[email protected]>
Commit: João Távora <[email protected]>
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 <[email protected]>
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