summaryrefslogtreecommitdiff
path: root/contrib/gcc/hashtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/hashtab.c')
-rw-r--r--contrib/gcc/hashtab.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/gcc/hashtab.c b/contrib/gcc/hashtab.c
index 7477c35c3bc0..37230d9f37c3 100644
--- a/contrib/gcc/hashtab.c
+++ b/contrib/gcc/hashtab.c
@@ -302,22 +302,24 @@ htab_expand (htab)
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;