From c4cb76bb13d01eaa93ee77ba5b490f5d1a991155 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 6 Jan 2018 01:33:40 +0100 Subject: libihash: Make sure we do not remove a locp several times Suggested by Brent W. Baccala. * libihash/ihash.c: Include . (locp_remove): Assert that item->value is valid. * libihash/Makefile (HURDLIBS): Add shouldbeinlibc. --- libihash/ihash.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libihash/ihash.c') diff --git a/libihash/ihash.c b/libihash/ihash.c index 2fc70930..1b255443 100644 --- a/libihash/ihash.c +++ b/libihash/ihash.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "ihash.h" @@ -110,6 +111,7 @@ static inline void locp_remove (hurd_ihash_t ht, hurd_ihash_locp_t locp) { struct _hurd_ihash_item *item = (struct _hurd_ihash_item *) locp; + assert_backtrace (hurd_ihash_value_valid (item->value)); if (ht->cleanup) (*ht->cleanup) (item->value, ht->cleanup_data); item->value = _HURD_IHASH_DELETED; -- cgit v1.2.3