mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 06:20:23 +02:00
* Signal an error when adding entries to a hash table with no slots.
This commit is contained in:
parent
b6efc9510e
commit
cbaadf0202
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
2000-07-07 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* hashtab.c (scm_hash_fn_create_handle_x): Signal an error if the
|
||||
given hash table has no slots.
|
||||
|
||||
2000-07-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* gc.c (policy_on_error): Added in order to allow alloc_some_heap
|
||||
|
|
|
@ -73,17 +73,18 @@ scm_hash_fn_get_handle (SCM table,SCM obj,unsigned int (*hash_fn)(),SCM (*assoc_
|
|||
}
|
||||
|
||||
|
||||
|
||||
SCM
|
||||
scm_hash_fn_create_handle_x (SCM table,SCM obj,SCM init,unsigned int (*hash_fn)(),
|
||||
SCM (*assoc_fn)(),void * closure)
|
||||
#define FUNC_NAME "scm_hash_fn_create_handle_x"
|
||||
{
|
||||
unsigned int k;
|
||||
SCM it;
|
||||
|
||||
SCM_ASSERT (SCM_VECTORP (table), table, SCM_ARG1, "hash_fn_create_handle_x");
|
||||
if (SCM_LENGTH (table) == 0)
|
||||
return SCM_EOL;
|
||||
SCM_MISC_ERROR ("void hashtable", SCM_EOL);
|
||||
|
||||
k = hash_fn (obj, SCM_LENGTH (table), closure);
|
||||
if (k >= SCM_LENGTH (table))
|
||||
scm_out_of_range ("hash_fn_create_handle_x", scm_ulong2num (k));
|
||||
|
@ -104,8 +105,7 @@ scm_hash_fn_create_handle_x (SCM table,SCM obj,SCM init,unsigned int (*hash_fn)(
|
|||
return SCM_CAR (new_bucket);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#undef FUNC_NAME
|
||||
|
||||
|
||||
SCM
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue