+2003-01-20 Josef Zlomek <zlomekj@suse.cz>
+
+ * hashtab.c (htab_expand): Fix allocation of new entries.
+
2002-11-19 Release Manager
* GCC 3.2.1 Released.
PTR *oentries;
PTR *olimit;
PTR *p;
+ size_t nsize;
oentries = htab->entries;
olimit = oentries + htab->size;
- htab->size = higher_prime_number (htab->size * 2);
+ nsize = higher_prime_number (htab->size * 2);
if (htab->return_allocation_failure)
{
- PTR *nentries = (PTR *) calloc (htab->size, sizeof (PTR *));
+ PTR *nentries = (PTR *) calloc (nsize, sizeof (PTR));
if (nentries == NULL)
return 0;
htab->entries = nentries;
}
else
- htab->entries = (PTR *) xcalloc (htab->size, sizeof (PTR *));
+ htab->entries = (PTR *) xcalloc (nsize, sizeof (PTR));
+ htab->size = nsize;
htab->n_elements -= htab->n_deleted;
htab->n_deleted = 0;