mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 23:00:22 +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>
|
2000-07-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
* gc.c (policy_on_error): Added in order to allow alloc_some_heap
|
* 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
|
||||||
scm_hash_fn_create_handle_x (SCM table,SCM obj,SCM init,unsigned int (*hash_fn)(),
|
scm_hash_fn_create_handle_x (SCM table,SCM obj,SCM init,unsigned int (*hash_fn)(),
|
||||||
SCM (*assoc_fn)(),void * closure)
|
SCM (*assoc_fn)(),void * closure)
|
||||||
|
#define FUNC_NAME "scm_hash_fn_create_handle_x"
|
||||||
{
|
{
|
||||||
unsigned int k;
|
unsigned int k;
|
||||||
SCM it;
|
SCM it;
|
||||||
|
|
||||||
SCM_ASSERT (SCM_VECTORP (table), table, SCM_ARG1, "hash_fn_create_handle_x");
|
SCM_ASSERT (SCM_VECTORP (table), table, SCM_ARG1, "hash_fn_create_handle_x");
|
||||||
if (SCM_LENGTH (table) == 0)
|
if (SCM_LENGTH (table) == 0)
|
||||||
return SCM_EOL;
|
SCM_MISC_ERROR ("void hashtable", SCM_EOL);
|
||||||
|
|
||||||
k = hash_fn (obj, SCM_LENGTH (table), closure);
|
k = hash_fn (obj, SCM_LENGTH (table), closure);
|
||||||
if (k >= SCM_LENGTH (table))
|
if (k >= SCM_LENGTH (table))
|
||||||
scm_out_of_range ("hash_fn_create_handle_x", scm_ulong2num (k));
|
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);
|
return SCM_CAR (new_bucket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#undef FUNC_NAME
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue