Fix wmap_compact from potentially corrupting ST table
commit6588bbfa442306d7dafd83da26ef56f41d0f3f81
authorPeter Zhu <[email protected]>
Mon, 21 Oct 2024 14:02:31 +0000 (21 10:02 -0400)
committerPeter Zhu <[email protected]>
Mon, 21 Oct 2024 15:00:15 +0000 (21 11:00 -0400)
tree64c588ddb9b2f8e2aac68712482c9f5213d436b2
parentef059707403df1182e61ca915efd676dc1eea116
Fix wmap_compact from potentially corrupting ST table

Since we hash by the address of the key in the WeakMap, we cannot change
the key in the same entry because deleting the key could require hashing.

This commit changes it to allocate and insert a new entry if the key has
moved.
weakmap.c