Browse Source

Fix bug with OAHashMap corruption on insertion

When an item has been inserted into an already-occupied slot, and
the original inhabitant of that slot was moved on, it was wrongly
moved with the inserted-item's key/value instead of its own.

This closes #22928.
Florian Jung 7 years ago
parent
commit
0353182e7b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/oa_hash_map.h

+ 2 - 2
core/oa_hash_map.h

@@ -125,7 +125,7 @@ private:
 
 		while (42) {
 			if (hashes[pos] == EMPTY_HASH) {
-				_construct(pos, hash, p_key, p_value);
+				_construct(pos, hash, key, value);
 
 				return;
 			}
@@ -136,7 +136,7 @@ private:
 
 				if (hashes[pos] & DELETED_HASH_BIT) {
 					// we found a place where we can fit in!
-					_construct(pos, hash, p_key, p_value);
+					_construct(pos, hash, key, value);
 
 					return;
 				}