util/set: don't compare against deleted entries
authorConnor Abbott <cwabbott0@gmail.com>
Sun, 15 Nov 2015 01:20:42 +0000 (20:20 -0500)
committerConnor Abbott <cwabbott0@gmail.com>
Tue, 2 Feb 2016 19:42:32 +0000 (14:42 -0500)
commit8fc2f652a29c7c307b9a076bbda4a5fce5e93361
tree5177e87a0d329564a343bed7e8b630eb2fbf76e1
parentbd97b62525e2d58870619b941d43c4545f922a2f
util/set: don't compare against deleted entries

When we delete entries in the hash set, we mark them "deleted" by
setting their key to the deleted_key, which points to a dummy
deleted_key_value. When searching for an entry, we normally skip over
those, but set_add() had some code for searching for duplicate entries
which forgot to skip over deleted entries. This led to a segfault inside
the NIR vectorization pass, since its key comparison function
interpreted the memory where deleted_key_value resides as a pointer and
tried to dereference it.

v2:
- add better commit message (Timothy)
- use entry_is_deleted (Timothy)

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
src/util/set.c