Repository navigation
Cut delegation edges - #192
Merged
Merged
Conversation
Contributor
|
This might be fixed by #190 also, but if that doesn't get merged soon we can just rebase that PR on top of this one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Delegation edges have a problem as seen in the following example:
Here, the PCG will not drop the borrow r_x for the write to x, since a delegation edge with *r_x exists at this point, and we are still using *p_x (that the delegation edge is connected to) at a later point. Therefore, the PCG prints an error:
PCG Assertion Failed : [main] No capability for xHowever, we expect another error from Prusti: The write to x should be possible and drop the borrow r_x regardless. Therefore, Prusti will exhale the permission for r_x (and p_x) at that point, printing correctly an error in the last line that we do not have permission to access *p_x. Therefore, a delegation must generally stay alive as long as we use the raw pointer but it must forcefully be cut if we try to access a place that is lent out to another place that (nestedly) contains such a delegation. This PR fixes this issue by cutting the delegation edges appropriately.
Disclaimer: Claude Code was used to write the changes in this PR.