Commit 0b59a65a authored by Alexander Larsson's avatar Alexander Larsson Committed by Akira TAGOH

fchash: Fix replace

When we replace a bucket in the hashtable we have to update the
next pointer too, or we lose all the other elements that hashed to
this key.
parent 7ca28c2f
......@@ -182,6 +182,7 @@ FcHashTableAddInternal (FcHashTable *table,
if (replace)
bucket->next = b->next;
if (!fc_atomic_ptr_cmpexch (prev, b, bucket))
goto retry;
bucket = b;
......@@ -191,6 +192,7 @@ FcHashTableAddInternal (FcHashTable *table,
goto destroy;
bucket->next = NULL;
if (!fc_atomic_ptr_cmpexch (prev, b, bucket))
goto retry;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment