summaryrefslogtreecommitdiff
path: root/libiberty/hashtab.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2003-01-20 19:03:56 +0000
committerDJ Delorie <dj@delorie.com>2003-01-20 19:03:56 +0000
commit4d84b5e016c21cf028ad32ecde6668f31677f4ec (patch)
treef8af200a1336086c55fd5421246c91700e582279 /libiberty/hashtab.c
parent161eaef3cb94cc607735771a004436ec045529db (diff)
downloadbinutils-redhat-4d84b5e016c21cf028ad32ecde6668f31677f4ec.tar.gz
merge from gcc
Diffstat (limited to 'libiberty/hashtab.c')
-rw-r--r--libiberty/hashtab.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index 6bf59ff737..27741ef624 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;