~ chicken-core (chicken-5) 743887ec07393e9a7c858c533566e26256a5609a


commit 743887ec07393e9a7c858c533566e26256a5609a
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Jun 19 13:35:55 2023 +0200
Commit:     Peter Bex <peter@more-magic.net>
CommitDate: Mon Jun 19 15:25:41 2023 +0200

    handle #!bwp in csi's "describe" function properly
    
    also adds guard clause to avoid segfault for newly
    introduced immediate types.
    
    Signed-off-by: Peter Bex <peter@more-magic.net>

diff --git a/csi.scm b/csi.scm
index ea618521..b3db4521 100644
--- a/csi.scm
+++ b/csi.scm
@@ -592,6 +592,9 @@ EOF
 	    ((eq? x #t) (fprintf out "boolean true~%"))
 	    ((eq? x #f) (fprintf out "boolean false~%"))
 	    ((null? x) (fprintf out "empty list~%"))
+            ((##core#inline "C_bwpp" x) 
+             ;; TODO: replace with bwp-object? later
+             (fprintf out "broken weak pointer~%"))
 	    ((eof-object? x) (fprintf out "end-of-file object~%"))
 	    ((eq? (##sys#void) x) (fprintf out "unspecified object~%"))
 	    ((fixnum? x)
@@ -657,6 +660,9 @@ EOF
 	       (##sys#slot x 7)
 	       (##sys#slot x 3)
 	       (##sys#peek-unsigned-integer x 0) ) )
+            ((not (##core#inline "C_blockp" x)) 
+             ;; catch immediates here, as ##sys#locative? crashes on non-block
+             (fprintf out "unknown immediate object~%"))
 	    ((##sys#locative? x)
 	     (fprintf out "locative~%  pointer ~X~%  index ~A~%  type ~A~%"
 	       (##sys#peek-unsigned-integer x 0)
Trap