Skip to content

[Runtime] Fix premature snapshot destruction in StableAddressConcurrentReadableHashMap::find. #35345

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

Merged
merged 1 commit into from
Jan 11, 2021

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Jan 11, 2021

Mark the relevant snapshot methods as ref-qualified (adding a & after the parameter list) so the compiler will enforce this for us and forbid calling them on temporaries.

rdar://72997638

@mikeash mikeash requested a review from davezarzycki January 11, 2021 15:51
Copy link
Contributor

@davezarzycki davezarzycki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find!

Non-blocking feedback: it would be good to add a comment about why these methods are ref-qualified, otherwise someone might be tempted remove the qualifier if they don't dig through SCM history.

…ntReadableHashMap::find.

Mark the relevant snapshot methods as ref-qualified (adding a & after the parameter list) so the compiler will enforce this for us and forbid calling them on temporaries.

rdar://72997638
@mikeash
Copy link
Contributor Author

mikeash commented Jan 11, 2021

Good idea, added comments.

@mikeash
Copy link
Contributor Author

mikeash commented Jan 11, 2021

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants