Fix deadlock bug in map insertion.

This commit is contained in:
Bob Nystrom
2015-08-06 06:55:30 -07:00
parent 71ab3ca887
commit 0631f3b109
2 changed files with 14 additions and 8 deletions
+3 -8
View File
@@ -388,14 +388,9 @@ static bool addEntry(MapEntry* entries, uint32_t capacity,
// If we found an open slot, the key is not in the table.
if (IS_UNDEFINED(entry->key))
{
// Don't stop at a tombstone, though, because the key may be found after
// it.
if (IS_FALSE(entry->value))
{
entry->key = key;
entry->value = value;
return true;
}
entry->key = key;
entry->value = value;
return true;
}
else if (wrenValuesEqual(entry->key, key))
{