mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-29 00:10:21 +02:00
* hashtab.c (scm_hash_fn_create_handle_x): If supplied assoc_fn
returns neither a pair nor #f, signal a wrong-type-arg error. (Thanks to Gregory Marton for reporting this.) * tests/hash.test: New "hashx" test supplied by Gregory Marton; prior to today's fix in libguile/hashtab.c, this caused a segmentation fault.
This commit is contained in:
parent
95da7a8613
commit
1978dd74b8
6 changed files with 29 additions and 1 deletions
2
NEWS
2
NEWS
|
@ -15,6 +15,8 @@ backtrace of a stack with a promise object (made by `delay') in it.
|
||||||
** Make `accept' leave guile mode while blocking
|
** Make `accept' leave guile mode while blocking
|
||||||
** `scm_c_read ()' and `scm_c_write ()' now type-check their port argument
|
** `scm_c_read ()' and `scm_c_write ()' now type-check their port argument
|
||||||
** Fixed a build problem on AIX (use of func_data identifier)
|
** Fixed a build problem on AIX (use of func_data identifier)
|
||||||
|
** Fixed a segmentation fault which occurred when hashx-ref or hashx-set! was
|
||||||
|
called with an associator proc that returns neither a pair nor #f.
|
||||||
|
|
||||||
* New modules (see the manual for details)
|
* New modules (see the manual for details)
|
||||||
|
|
||||||
|
|
1
THANKS
1
THANKS
|
@ -53,6 +53,7 @@ For fixes or providing information which led to a fix:
|
||||||
Matt Kraai
|
Matt Kraai
|
||||||
Jeff Long
|
Jeff Long
|
||||||
Marco Maggi
|
Marco Maggi
|
||||||
|
Gregory Marton
|
||||||
Dan McMahill
|
Dan McMahill
|
||||||
Han-Wen Nienhuys
|
Han-Wen Nienhuys
|
||||||
Jan Nieuwenhuizen
|
Jan Nieuwenhuizen
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2008-01-18 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
|
* hashtab.c (scm_hash_fn_create_handle_x): If supplied assoc_fn
|
||||||
|
returns neither a pair nor #f, signal a wrong-type-arg error.
|
||||||
|
(Thanks to Gregory Marton for reporting this.)
|
||||||
|
|
||||||
2007-12-29 Neil Jerram <neil@ossau.uklinux.net>
|
2007-12-29 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
* gc.c (mark_gc_async): Change "func_data" to "fn_data", to avoid
|
* gc.c (mark_gc_async): Change "func_data" to "fn_data", to avoid
|
||||||
|
|
|
@ -454,8 +454,10 @@ scm_hash_fn_create_handle_x (SCM table, SCM obj, SCM init, unsigned long (*hash_
|
||||||
if (k >= SCM_SIMPLE_VECTOR_LENGTH (buckets))
|
if (k >= SCM_SIMPLE_VECTOR_LENGTH (buckets))
|
||||||
scm_out_of_range ("hash_fn_create_handle_x", scm_from_ulong (k));
|
scm_out_of_range ("hash_fn_create_handle_x", scm_from_ulong (k));
|
||||||
it = assoc_fn (obj, SCM_SIMPLE_VECTOR_REF (buckets, k), closure);
|
it = assoc_fn (obj, SCM_SIMPLE_VECTOR_REF (buckets, k), closure);
|
||||||
if (scm_is_true (it))
|
if (scm_is_pair (it))
|
||||||
return it;
|
return it;
|
||||||
|
else if (scm_is_true (it))
|
||||||
|
scm_wrong_type_arg_msg (NULL, 0, it, "a pair");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* When this is a weak hashtable, running the GC can change it.
|
/* When this is a weak hashtable, running the GC can change it.
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2008-01-18 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
|
* tests/hash.test: New "hashx" test supplied by Gregory Marton;
|
||||||
|
prior to today's fix in libguile/hashtab.c, this caused a
|
||||||
|
segmentation fault.
|
||||||
|
|
||||||
2007-12-29 Neil Jerram <neil@ossau.uklinux.net>
|
2007-12-29 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
* standalone/test-bad-identifiers: New test.
|
* standalone/test-bad-identifiers: New test.
|
||||||
|
|
|
@ -72,3 +72,14 @@
|
||||||
(hashx-set! hashq assq table 'x 123)
|
(hashx-set! hashq assq table 'x 123)
|
||||||
(hashx-remove! hashq assq table 'x)
|
(hashx-remove! hashq assq table 'x)
|
||||||
(null? (hash-map->list noop table)))))
|
(null? (hash-map->list noop table)))))
|
||||||
|
|
||||||
|
;;;
|
||||||
|
;;; hashx
|
||||||
|
;;;
|
||||||
|
|
||||||
|
(with-test-prefix "hashx"
|
||||||
|
(pass-if-exception
|
||||||
|
"hashx-set! (lambda (k s) 1) (lambda (k al) #t) table 'foo 'bar"
|
||||||
|
exception:wrong-type-arg
|
||||||
|
(hashx-set! (lambda (k s) 1) (lambda (k al) #t) (make-hash-table) 'foo 'bar))
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue