public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-268] libiberty: fix type in allocation
@ 2022-05-10 15:33 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2022-05-10 15:33 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5dac43b43c3999f94b451cd7925e24d8e7c38a7a

commit r13-268-g5dac43b43c3999f94b451cd7925e24d8e7c38a7a
Author: Martin Liska <mliska@suse.cz>
Date:   Tue May 10 17:31:24 2022 +0200

    libiberty: fix type in allocation
    
    The allocation function alloc_f is called for nsize
    items where each is of type void *.
    
    libiberty/ChangeLog:
    
            * hashtab.c (htab_empty): Use void * type instead of void **.
            (htab_expand): Likewise.
    
    Co-Authored-By: Alan Modra <amodra@gmail.com>

Diff:
---
 libiberty/hashtab.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index f7621cd47e5..470d3e66c32 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -458,9 +458,9 @@ htab_empty (htab_t htab)
 	(*htab->free_with_arg_f) (htab->alloc_arg, htab->entries);
       if (htab->alloc_with_arg_f != NULL)
 	htab->entries = (void **) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize,
-						           sizeof (void **));
+							     sizeof (void *));
       else
-	htab->entries = (void **) (*htab->alloc_f) (nsize, sizeof (void **));
+	htab->entries = (void **) (*htab->alloc_f) (nsize, sizeof (void *));
      htab->size = nsize;
      htab->size_prime_index = nindex;
     }
@@ -544,9 +544,9 @@ htab_expand (htab_t htab)
 
   if (htab->alloc_with_arg_f != NULL)
     nentries = (void **) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize,
-						  sizeof (void **));
+						    sizeof (void *));
   else
-    nentries = (void **) (*htab->alloc_f) (nsize, sizeof (void **));
+    nentries = (void **) (*htab->alloc_f) (nsize, sizeof (void *));
   if (nentries == NULL)
     return 0;
   htab->entries = nentries;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-10 15:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 15:33 [gcc r13-268] libiberty: fix type in allocation Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).