master: Fortify SB-INTROSPECT:FIND-DEFINITION-SOURCES a bit

melisgl via Sbcl-commits <[email protected]> Mon, 29 Jun 2026 12:19:19 +0000
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  6ac843434ae870fd85547d5de7afd0d6e49f877d (commit)
      from  1d412776bbdde08161837585b8554dde569c3f6f (commit)

- Log -----------------------------------------------------------------
commit 6ac843434ae870fd85547d5de7afd0d6e49f877d
Author: Gabor Melis <[email protected]>
Date:   Sat Jun 6 17:37:30 2026 +0200

    Fortify SB-INTROSPECT:FIND-DEFINITION-SOURCES a bit
    
    Not sure how to reproduce the failure.
---
 contrib/sb-introspect/introspect.lisp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/sb-introspect/introspect.lisp b/contrib/sb-introspect/introspect.lisp
index 9883264d8..bbfe71463 100644
--- a/contrib/sb-introspect/introspect.lisp
+++ b/contrib/sb-introspect/introspect.lisp
@@ -597,8 +597,9 @@ FIND-DEFINITION-SOURCES-BY-NAME."
      (when (stringp (sb-c::debug-source-namestring debug-source))
        (parse-namestring (sb-c::debug-source-namestring debug-source)))
      :character-offset
-     (if tlf
-         (elt (sb-c::debug-source-start-positions debug-source) tlf))
+     (let ((start-positions (sb-c::debug-source-start-positions debug-source)))
+       (when (and tlf (< tlf (length start-positions)))
+         (elt start-positions tlf)))
      :form-path (if tlf (list tlf))
      :form-number (handler-case (sb-di::code-location-form-number
                                  (sb-di::debug-fun-start-location debug-fun))

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL