diff options
author | Josef Zlomek <zlomekj@suse.cz> | 2003-01-20 19:41:47 +0100 |
---|---|---|
committer | Josef Zlomek <zlomek@gcc.gnu.org> | 2003-01-20 18:41:47 +0000 |
commit | 02a85877b0f870a04b6905bf801d2289a4f52269 (patch) | |
tree | 8b0da6d9a97a5af91770140fda4570ae38e6d550 /libiberty | |
parent | 9782d03654543217e0605951872fc5463d11086b (diff) |
* hashtab.c (htab_expand): Fix allocation of new entries.
From-SVN: r61508
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 4 | ||||
-rw-r--r-- | libiberty/hashtab.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 7280aa03747..2fa32f90318 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,7 @@ +2003-01-20 Josef Zlomek <zlomekj@suse.cz> + + * hashtab.c (htab_expand): Fix allocation of new entries. + 2002-12-04 Danny Smith <dannysmith@users.sourceforge.net> * make-relative-prefix.c (HAVE_HOST_EXECUTABLE_SUFFIX): diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index 6bf59ff7378..27741ef6247 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -306,16 +306,18 @@ htab_expand (htab) PTR *olimit; PTR *p; PTR *nentries; + 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); - nentries = (PTR *) (*htab->alloc_f) (htab->size, sizeof (PTR *)); + nentries = (PTR *) (*htab->alloc_f) (nsize, sizeof (PTR)); if (nentries == NULL) return 0; htab->entries = nentries; + htab->size = nsize; htab->n_elements -= htab->n_deleted; htab->n_deleted = 0; |