clang 24.0.0git
clang::ento::bounds Namespace Reference

Classes

struct  CheckFlags
class  CheckResult

Functions

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.

Function Documentation

◆ checkBounds()

bounds::CheckResult clang::ento::bounds::checkBounds ( ProgramStateRef State,
SValBuilder & SVB,
NonLoc Offset,
std::optional< NonLoc > Extent,
bounds::CheckFlags Flags )

Checks the validity of accessing a memory region with extent Extent at offset Offset.

The Flags influence the semantics of the check, in particular if AcceptPastTheEnd is true, then Offset == Extent is also accepted as valid.

Definition at line 136 of file BoundsChecking.cpp.

References clang::ento::bounds::CheckFlags::AcceptPastTheEnd, clang::ento::bounds::CheckFlags::CheckUnderflow, compareValueToThreshold(), clang::ento::SValBuilder::makeZeroArrayIndex(), and clang::ento::bounds::CheckFlags::OffsetObviouslyNonnegative.