summaryrefslogtreecommitdiff
path: root/libiberty/hashtab.c
diff options
context:
space:
mode:
authorzlomek <zlomek@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-20 18:41:01 +0000
committerzlomek <zlomek@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-20 18:41:01 +0000
commitaa5761b742fda869dca2e21178f9b9a98006e837 (patch)
treea282ef47d87b0554258bd0643999999a95e7602e /libiberty/hashtab.c
parentd06159143899fbbc2d6ecb86ec193ebb0c6f12b9 (diff)
downloadgcc-aa5761b742fda869dca2e21178f9b9a98006e837.tar.gz
* hashtab.c (htab_expand): Fix allocation of new entries.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61507 138bc75d-0d04-0410-961f-82ee72b054a4
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 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;