-
Notifications
You must be signed in to change notification settings - Fork 413
TreeBorrows: split Tree::perform_protector_release_access from Tree::perform_access
#4741
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
base: master
Are you sure you want to change the base?
TreeBorrows: split Tree::perform_protector_release_access from Tree::perform_access
#4741
Conversation
|
Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! Just some minor nits.
| access_range_and_kind: Option<(AllocRange, AccessKind, diagnostics::AccessCause)>, | ||
| access_range: AllocRange, | ||
| access_kind: AccessKind, | ||
| access_cause: AccessCause, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
access_cause is also just used for diagnostics I assume?
| } | ||
| interp_ok(()) | ||
| } | ||
| /// this is the special access that is applied on protector release: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// this is the special access that is applied on protector release: | |
| /// This is the special access that is applied on protector release: |
| /// - and it will be a read except if the location is `Unique`, i.e. has been written to, | ||
| /// in which case it will be a write. | ||
| /// - otherwise identical to `Tree::perform_access` | ||
| pub fn perform_protector_release_access( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we more typically call this "protector end access", so
| pub fn perform_protector_release_access( | |
| pub fn perform_protector_end_access( |
The
Tree::perform_accessfunction currently is used for both normal accesses and protector release accesses.However, both of these are handled by different branches and don't share any code, so this splits them into two separate functions.