chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] hash table segfault?


From: felix winkelmann
Subject: Re: [Chicken-users] hash table segfault?
Date: Fri, 11 Nov 2005 15:11:25 +0100

On 11/10/05, David Janssens <address@hidden> wrote:
> I think i found a bug in chicken:
>
> (set! h (make-hash-table))
> (hash-table-set! h "foo" "bar")
> (hash-table-fold h (lambda (k c acc) #f) '())
> Segmentation fault (core dumped)
>

Indeed. Here a patch for extras.scm:

1788,1789c1788,1789
<           (let fold2 ((bp (##sys#slot vec i)))
<             (if (null? bp)
---
>           (let fold2 ((buckets (##sys#slot vec i)) (acc acc))
>             (if (null? buckets)
1791,1793c1791,1795
<                 (fold2 (p (##sys#slot bp 0)
<                           (##sys#slot bp 1)
<                           acc) ) ) ) ) ) ) ) )
---
>                 (let ((b (##sys#slot buckets 0)))
>                   (fold2 (##sys#slot buckets 1)
>                          (p (##sys#slot b 0)
>                             (##sys#slot b 1)
>                             acc) ) ) ) ) ) ) ) ) )

Thanks for reporting this.


cheers,
felix




reply via email to

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