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

Classes

struct  CheckFlags
class  CheckResult

Enumerations

enum class  Comparison { LT , LE , EQ }

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.
BinaryOperator::Opcode asOpcode (Comparison C)
std::pair< ProgramStateRef, ProgramStateRefcompareValueToThreshold (ProgramStateRef State, SValBuilder &SVB, NonLoc Value, NonLoc Threshold, Comparison CmpKind)

Enumeration Type Documentation

◆ Comparison

Enumerator
LT 
LE 
EQ 

Definition at line 95 of file BoundsChecking.h.

Function Documentation

◆ asOpcode()

BinaryOperator::Opcode clang::ento::bounds::asOpcode ( Comparison C)
inline

Definition at line 97 of file BoundsChecking.h.

References clang::C, EQ, LE, and LT.

Referenced by compareValueToThreshold().

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

Definition at line 128 of file BoundsChecking.cpp.

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

◆ compareValueToThreshold()

std::pair< ProgramStateRef, ProgramStateRef > clang::ento::bounds::compareValueToThreshold ( ProgramStateRef State,
SValBuilder & SVB,
NonLoc Value,
NonLoc Threshold,
Comparison CmpKind )