[Mesa-dev] [PATCH 1/5] util/set: don't compare against deleted entries

Jason Ekstrand jason at jlekstrand.net
Wed Nov 18 10:05:41 PST 2015


On Sat, Nov 14, 2015 at 6:59 PM, Connor Abbott <cwabbott0 at gmail.com> wrote:
> Not sure how this wasn't already caught by valgrind, but it fixes an
> issue with the vectorizer.

Ugh... I'm getting tired of fixing these bugs.

> Signed-off-by: Connor Abbott <cwabbott0 at gmail.com>

Both are

Cc: "11.0" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

> ---
>  src/util/set.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/util/set.c b/src/util/set.c
> index f01f869..331ff58 100644
> --- a/src/util/set.c
> +++ b/src/util/set.c
> @@ -282,7 +282,8 @@ set_add(struct set *ht, uint32_t hash, const void *key)
>         * If freeing of old keys is required to avoid memory leaks,
>         * perform a search before inserting.
>         */
> -      if (entry->hash == hash &&
> +      if (entry_is_present(entry) &&
> +          entry->hash == hash &&
>            ht->key_equals_function(key, entry->key)) {
>           entry->key = key;
>           return entry;
> --
> 2.4.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list