On 9/22/06, Peter Bex <[EMAIL PROTECTED]> wrote:
Hi list,

I just found that an invalid property-condition causes Chicken to segfault:
(abort (make-property-condition 'exn 'location "string"
                                     'message "error"
                                     'arguments '()))

The reason is that location needs to be a symbol, not a string.  Of
course, a type check would be in order here :)

That's right, here is the patch:

- old-chicken/library.scm       2006-09-25 11:08:46.218404800 +0200
+++ new-chicken/library.scm     2006-09-25 11:08:46.265397656 +0200
@@ -3330,7 +3330,7 @@
                    (if msga
                        (let ([msg (cadr msga)]
                              [loc (and loca (cadr loca))] )
-                         (if loc
+                         (if (and loc (symbol? loc))
                              (string-append "(" (##sys#symbol->qualified-string loc) 
") " msg)
                              msg) )
                        "<exn: has no `message' property>")
@@ -3963,7 +3963,7 @@
               (cond ((errmsg ex) =>
                      (lambda (msg)
                        (let ([loc (errloc ex)])
-                         (when loc
+                         (when (and loc (symbol? loc))
                            (display (string-append "(" 
(##sys#symbol->qualified-string
loc) ") ") port) ) )
                        (display msg port) ) )
                     (else

Thanks for reporting this.


cheers,
felix


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to