-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PeristentHashMapBuilder.putAll() with another persistent hash map can produce incorrect results. #114
Comments
The was originally found in Compose: https://issuetracker.google.com/issues/193433239 |
The issue appears to me to be centered around this line, It inverts the |
I created a candidate fix in #115. This seems to work when I test it in the Compose local copy of this code. |
… produce incorrect results #114 When putting all entries of a cell (1) into another cell (2), if (1) is an entry and (2) is a node, for optimization reasons the entry is put into the node. This leads to saving the old value of the entry if the node already contains the key.
@chuckjaz do you need an immediate release with the fix? |
No. We use a renamed copy of this code because it is not stable. A fix that you approve of would be sufficient then I will cherry-pick the change into our sources. |
When the #116 lands I will cherry-pick the result into our sources. |
Understood. |
It was @igordmn's original report. I just narrowed it down a bit further. |
… produce incorrect results #114 When putting all entries of a cell (1) into another cell (2), if (1) is an entry and (2) is a node, for optimization reasons the entry is put into the node. This leads to saving the old value of the entry if the node already contains the key.
… produce incorrect results #114 When putting all entries of a cell (1) into another cell (2), if (1) is an entry and (2) is a node, for optimization reasons the entry is put into the node. This leads to saving the old value of the entry if the node already contains the key.
Consider the following code:
Expected
n[99] = 99
Received
n[99] = 1
Changing the
putAll
call above toputAll(e)
produces the expected result.The text was updated successfully, but these errors were encountered: