Skip to content

Update bounds checking notes#1166

Merged
kkjeer merged 6 commits into
masterfrom
update-bounds-checking-notes
Aug 31, 2021
Merged

Update bounds checking notes#1166
kkjeer merged 6 commits into
masterfrom
update-bounds-checking-notes

Conversation

@kkjeer

@kkjeer kkjeer commented Aug 23, 2021

Copy link
Copy Markdown
Contributor

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".

@sulekhark sulekhark left a comment

Copy link
Copy Markdown
Contributor

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