Skip to content

Fix the semantics of DenseHashMap to be consistent even when inserting nulls#18129

Merged
hrydgard merged 2 commits intomasterfrom
hashmap-semantics-fix
Sep 11, 2023
Merged

Fix the semantics of DenseHashMap to be consistent even when inserting nulls#18129
hrydgard merged 2 commits intomasterfrom
hashmap-semantics-fix

Conversation

@hrydgard
Copy link
Owner

@hrydgard hrydgard commented Sep 11, 2023

We've always had an uncomfortable ambiguity where you could insert nulls, but they'd return null like they weren't there and there was no way to check if a null had actually been inserted before, leading to double-insert asserts if you checked for an existing item before inserting but the previous item was a nullptr.

With this, the semantics are more normal. This allows us to fix one of the crashes from #18116.

@hrydgard hrydgard added the Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. label Sep 11, 2023
@hrydgard hrydgard added this to the v1.16.1 milestone Sep 11, 2023
@hrydgard hrydgard merged commit b83e89a into master Sep 11, 2023
@hrydgard hrydgard deleted the hashmap-semantics-fix branch September 11, 2023 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Cleanup Cleanup to make future work easier. Needs to be done sometimes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant