From 62de703f1990d2c4dd7ee0c41bfa886b5c589793 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 14 Mar 2019 18:47:01 -0400 Subject: hash-table.h (remove_elt_with_hash): Return if slot is NULL rather than if is_empty (*slot). * hash-table.h (remove_elt_with_hash): Return if slot is NULL rather than if is_empty (*slot). * hash-set-tests.c (test_set_of_strings): Add tests for addition of existing elt and for elt removal. * hash-map-tests.c (test_map_of_strings_to_int): Add test for removal of already removed elt. * hashtab.c (htab_remove_elt_with_hash): Return if slot is NULL rather than if *slot is HTAB_EMPTY_ENTRY. Co-Authored-By: Jakub Jelinek From-SVN: r269695 --- libiberty/ChangeLog | 6 ++++++ libiberty/hashtab.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'libiberty') diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index f632558..cc44e421 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2019-03-14 Jason Merrill + Jakub Jelinek + + * hashtab.c (htab_remove_elt_with_hash): Return if slot is NULL rather + than if *slot is HTAB_EMPTY_ENTRY. + 2019-02-11 Philippe Waroquiers * splay-tree.c (splay_tree_insert): Also release old KEY in case diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index 880c878..9f917c3 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -725,7 +725,7 @@ htab_remove_elt_with_hash (htab_t htab, PTR element, hashval_t hash) PTR *slot; slot = htab_find_slot_with_hash (htab, element, hash, NO_INSERT); - if (*slot == HTAB_EMPTY_ENTRY) + if (slot == NULL) return; if (htab->del_f) -- cgit v1.1