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.
[analyzer] Switch to PostStmt callbacks in ArrayBoundV2 #72107
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
[analyzer] Switch to PostStmt callbacks in ArrayBoundV2 #72107
Changes from all commits
ab102e9
819a21b
5ae2f66
4044f86
4fb7355
9c85c7e
017b1d6
a422b32
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is this transition needed? This checker should not add assumptions to the state, only check for conditions and add only error transitions.
EqualsToThreshold
probably does not contain new information compared toState
.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.
You're right that
EqualsToThreshold
does not contain new information compared toState
, but I'm using it because I'm trying to follow the pattern that I'm always using the most recent state variable.On the other hand, the variable$[-\infty, -1] \cup \{ 10\}$ for the index variable, then we first test for underflow and update the variable
State
may contain new information compared to the state of the node before the start of this callback: e.g. if we start with a range set likeState
when we assume that there is no underflow.I think it's valuable to record these assumptions with a state transition, because they improve the accuracy of the modeling. (Otherwise the analyzer could produce bug reports that rely on assumptions that contradict each other.) Currently the assumptions of this checker are added silently but I'll add note tags like "Assuming index is non-negative" for them in a followup commit.