Skip to content
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

Update bounds checking notes #1166

Merged
merged 6 commits into from
Aug 31, 2021
Merged

Update bounds checking notes #1166

merged 6 commits into from
Aug 31, 2021

Conversation

kkjeer
Copy link
Contributor

@kkjeer kkjeer commented Aug 23, 2021

This PR makes a minor modification to the notes emitted during bounds checking:

Only one note is emitted per statement per lvalue expression for an expression with unknown bounds being assigned to an lvalue expression.
For example:

void f(_Array_ptr<int> p : count(1), _Array_ptr<int> q : bounds(unknown) {
  p = q, p++;
}

Both assignments p = q and p++ assign expressions (q and p + 1 respectively) with unknown bounds to p. A note will only be emitted for the first assignment. This helps avoid confusion in the note messages - it may be unclear to the user why the expression p++ would result in the note "assigned expression p + 1 with unknown bounds to p".

Copy link
Contributor

@sulekhark sulekhark left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@kkjeer kkjeer merged commit 99176ef into master Aug 31, 2021
@kkjeer kkjeer deleted the update-bounds-checking-notes branch August 31, 2021 02:12
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