summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAdrian Moreno <amorenoz@redhat.com>2022-03-23 12:56:16 +0100
committerIlya Maximets <i.maximets@ovn.org>2022-03-30 16:59:02 +0200
commit860e69a8c3d6994dc000b37d682bd16cd2925bef (patch)
treeb290b1962d59606fbd90dfdd8e8128b091c97bff /tests
parent9e8d960a6b5258626130be611ae090dacbb4dc7c (diff)
downloadopenvswitch-860e69a8c3d6994dc000b37d682bd16cd2925bef.tar.gz
hmap: implement UB-safe hmap pop iterator.
HMAP_FOR_EACH_POP iterator has an additional difficulty, which is the use of two iterator variables of different types. In order to re-write this loop in a UB-safe manner, create a iterator struct to be used as loop variable. Acked-by: Dumitru Ceara <dceara@redhat.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-hmap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/test-hmap.c b/tests/test-hmap.c
index a40ac8953..47b475538 100644
--- a/tests/test-hmap.c
+++ b/tests/test-hmap.c
@@ -317,6 +317,7 @@ test_hmap_for_each_pop(hash_func *hash)
i++;
}
assert(i == n);
+ assert(e == NULL);
hmap_destroy(&hmap);
}