From: Josef Zlomek Date: Thu, 30 Oct 2003 17:00:51 +0000 (+0100) Subject: hashtab.c (htab_find_slot_with_hash): Decrease n_deleted instead of increasing n_elem... X-Git-Tag: releases/gcc-3.4.0~2613 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0432c1c143af0e0f6b45d9606e62973373b714d;p=thirdparty%2Fgcc.git hashtab.c (htab_find_slot_with_hash): Decrease n_deleted instead of increasing n_elements when inserting to deleted slot. * hashtab.c (htab_find_slot_with_hash): Decrease n_deleted instead of increasing n_elements when inserting to deleted slot. From-SVN: r73090 --- diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 6264fbf5a0b9..34f421e19492 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2003-10-30 Josef Zlomek + + * 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 * cplus-dem.c (demangle_template): Register a new Btype only diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index cbf82592be1e..231fbc0dd7ad 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -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]; }