|
clang 24.0.0git
|
#include "clang/StaticAnalyzer/Checkers/BoundsChecking.h"
Public Member Functions | |
| bool | isCorruptedState () const |
| When true, the bounds check noticed that the value of an unsigned expression is constrained to negative values (because the analyzer skipped the modeling of a cast expression). | |
| bool | mayBeInBounds () const |
| When true, the checked offset may be in bounds. | |
| bool | mayUnderflow () const |
| When true, the checked offset may be negative. | |
| bool | mayOverflow () const |
| When true, the checked offset may be >= the extent of the region. | |
| bool | mayBeInvalid () const |
| When true, the checked offset may be out of bounds. | |
| NonLoc | getOffset () const |
| Returns the offset of the accessed location from the beginning of the accessd region. | |
| std::optional< NonLoc > | getExtentIfMayOverflow () const |
| Returns the extent of the accessed region if it is relevant (because the offset may overflow it), otherwise returns std::nullopt. | |
| ProgramStateRef | getInBoundsState () const |
| Returns the program state that should be used for continuing the analysis after this bounds check. | |
Friends | |
| CheckResult | checkBounds (ProgramStateRef State, SValBuilder &SVB, NonLoc Offset, std::optional< NonLoc > Extent, CheckFlags Flags) |
Checks the validity of accessing a memory region with extent Extent at offset Offset. | |
Definition at line 41 of file BoundsChecking.h.
|
inline |
Returns the extent of the accessed region if it is relevant (because the offset may overflow it), otherwise returns std::nullopt.
Definition at line 67 of file BoundsChecking.h.
Referenced by describeInvalidAccess(), and getAssumptionNote().
|
inline |
Returns the program state that should be used for continuing the analysis after this bounds check.
This returns null if mayBeInBounds() is false, in that case the state before the check should be used in the error node.
Definition at line 74 of file BoundsChecking.h.
|
inline |
Returns the offset of the accessed location from the beginning of the accessd region.
Definition at line 63 of file BoundsChecking.h.
Referenced by describeInvalidAccess(), and getAssumptionNote().
|
inline |
When true, the bounds check noticed that the value of an unsigned expression is constrained to negative values (because the analyzer skipped the modeling of a cast expression).
This execution path must be discarded because it does not represent a real possibility. FIXME: This hack is currently needed to filter out many ugly false positives; but it should be removed when we fix cast modeling.
Definition at line 49 of file BoundsChecking.h.
|
inline |
When true, the checked offset may be in bounds.
Definition at line 52 of file BoundsChecking.h.
|
inline |
When true, the checked offset may be out of bounds.
Definition at line 59 of file BoundsChecking.h.
Referenced by describeInvalidAccess(), and describeTaintBug().
|
inline |
When true, the checked offset may be >= the extent of the region.
Definition at line 57 of file BoundsChecking.h.
Referenced by describeInvalidAccess(), describeTaintBug(), and getAssumptionNote().
|
inline |
When true, the checked offset may be negative.
Definition at line 55 of file BoundsChecking.h.
Referenced by describeInvalidAccess(), describeTaintBug(), and getAssumptionNote().
|
friend |
Checks the validity of accessing a memory region with extent Extent at offset Offset.
The Flags influence the semantics of the check.