Rust: Query for access to a dangling pointer#18300
Closed
geoffw0 wants to merge 12 commits intogithub:mainfrom
Closed
Rust: Query for access to a dangling pointer#18300geoffw0 wants to merge 12 commits intogithub:mainfrom
geoffw0 wants to merge 12 commits intogithub:mainfrom
Conversation
geoffw0
commented
Dec 16, 2024
| maybeOnStack(a, ce.getEnclosingBlock()) and | ||
| ce.getStaticTarget() = b.getEnclosingCallable() | ||
| ) | ||
| } |
Contributor
Author
There was a problem hiding this comment.
An entirely different approach is possible, where having done the data flow we would check the control flow as well, all the way from the pointer creation to dereference, to see if it crosses a point where the objects lifetime ends. I ran into problems even defining these points, wasn't sure how best to implement that kind of flow effectively, and my attempts didn't get good results so I changed tactics. Nevertheless it could be more accurate in the sense of finding more results, and some of these issues might get easier as our libraries mature.
Contributor
Author
|
Closing. I'm going to reassemble the pieces into two or three separate queries, and in the process hopefully remember where I was with this work. |
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.
Query for access to a dangling pointer, i.e. something along the lines of:
This is a draft because I still need to:
Then I will need:
As you can see from the test, there are a lot of cases we don't cover yet, which will be follow-up work. Right now I want to get a minimal version of the query merged before worrying about them too much.