diff options
author | DJ Delorie <dj@redhat.com> | 2003-01-20 19:03:56 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2003-01-20 19:03:56 +0000 |
commit | eed2b28c05201aea858a67394caa03e0fcff3bcb (patch) | |
tree | 904e12643e4b4e52ea639d30e90dfb44c24af52a | |
parent | 571fe01fe0fda48588110eec401755cd82a512e7 (diff) | |
download | gdb-eed2b28c05201aea858a67394caa03e0fcff3bcb.zip gdb-eed2b28c05201aea858a67394caa03e0fcff3bcb.tar.gz gdb-eed2b28c05201aea858a67394caa03e0fcff3bcb.tar.bz2 |
merge from gcc
-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 3b236b0..e8f0ce2 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. + 2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de> * Makefile.in (FLAGS_TO_PASS): Also pass DESTDIR. diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index 6bf59ff..27741ef 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; |