]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
hashtab.c (htab_find_slot_with_hash): Decrease n_deleted instead of increasing n_elem...
authorJosef Zlomek <zlomekj@suse.cz>
Thu, 30 Oct 2003 17:00:51 +0000 (18:00 +0100)
committerJosef Zlomek <zlomek@gcc.gnu.org>
Thu, 30 Oct 2003 17:00:51 +0000 (17:00 +0000)
* hashtab.c (htab_find_slot_with_hash): Decrease n_deleted
instead of increasing n_elements when inserting to deleted slot.

From-SVN: r73090

libiberty/ChangeLog
libiberty/hashtab.c

index 6264fbf5a0b9e82a7a1dbcb5654c62d2847aac57..34f421e194926888934641db81fd55aec5d34999 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-30  Josef Zlomek  <zlomekj@suse.cz>
+
+       * hashtab.c (htab_find_slot_with_hash): Decrease n_deleted
+       instead of increasing n_elements when inserting to deleted slot.
+
 2003-10-20  J. Brobecker  <brobecker@gnat.com>
 
        * cplus-dem.c (demangle_template): Register a new Btype only
index cbf82592be1ef60ac18cc5bba7112ca86f253322..231fbc0dd7ad1a589d479188afe3a965cacb7c0e 100644 (file)
@@ -535,14 +535,14 @@ htab_find_slot_with_hash (htab, element, hash, insert)
   if (insert == NO_INSERT)
     return NULL;
 
-  htab->n_elements++;
-
   if (first_deleted_slot)
     {
+      htab->n_deleted--;
       *first_deleted_slot = EMPTY_ENTRY;
       return first_deleted_slot;
     }
 
+  htab->n_elements++;
   return &htab->entries[index];
 }