-
Notifications
You must be signed in to change notification settings - Fork 75
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
Detect Array out of bounds #257
Merged
Merged
Conversation
This file contains 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
…arrayoob-zerocheck
- must vs may - before array vs past array end
LogEvent -> Warning EventType -> Warn IntegerEvent -> Integer> ...
jerhard
reviewed
Jul 1, 2021
tests/regression/26-undefined_behavior/07-arrays-within-structures.c
Outdated
Show resolved
Hide resolved
tests/regression/26-undefined_behavior/07-arrays-within-structures.c
Outdated
Show resolved
Hide resolved
also renames Warning -> WarningWithCertainty and WarnType -> Warning
also remove the array type because arrayoob is under UB
also uses concatenation instead of redundant sprintf
and replace unused parameters with `_`
also adds optional location to warn_each
this eliminates the need to specify the regexes separately in update_suite.rb later it would probably be nice if the categories were parsed and checked there also changes formatting of the warning tags
also adds optional msg argument and removes string params from unknown and debug
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.
This PR fixes #198
We introduced detection for out of bounds accesses in arrays. This works for both statically and dynamically sized arrays. With interval analysis enabled we can also properly detect out of bounds accesses inside for loops or other constructs taken into account by the interval analysis.
We added regression tests for the following cases:
The warnings fall into the
behavior
category and in the new warning system, they can be disabled with--disable dbg.warn.behavior
along with other Behavior warnings.The warnings are also tagged as May/Must according to the certainty with which we know that the situation occurs.
The warning can also specify if the access happened PastEnd, BeforeStart or Unknown