clang 20.0.0git
|
#include "NoOwnershipChangeVisitor.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
#include "llvm/ADT/Sequence.h"
#include <functional>
#include <optional>
Go to the source code of this file.
Functions | |
static std::optional< int64_t > | getKnownValue (ProgramStateRef State, SVal V) |
static ProgramStateRef | escapeByStartIndexAndCount (ProgramStateRef State, const CallEvent &Call, unsigned BlockCount, const SubRegion *Buffer, QualType ElemType, int64_t StartIndex, int64_t ElementCount) |
Invalidate only the requested elements instead of the whole buffer. | |
static ProgramStateRef | escapeArgs (ProgramStateRef State, CheckerContext &C, const CallEvent &Call, ArrayRef< unsigned int > EscapingArgs) |
static QualType | getPointeeType (const MemRegion *R) |
static std::optional< NonLoc > | getStartIndex (SValBuilder &SVB, const MemRegion *R) |
static ProgramStateRef | tryToInvalidateFReadBufferByElements (ProgramStateRef State, CheckerContext &C, const CallEvent &Call, NonLoc SizeVal, NonLoc NMembVal) |
static const VarDecl * | getGlobalStreamPointerByName (const TranslationUnitDecl *TU, StringRef VarName) |
|
static |
Definition at line 866 of file StreamChecker.cpp.
References clang::C, and clang::Call.
|
static |
Invalidate only the requested elements instead of the whole buffer.
This is basically a refinement of the more generic 'escapeArgs' or the plain old 'invalidateRegions'.
Definition at line 836 of file StreamChecker.cpp.
References clang::Call, clang::ento::SubRegion::getMemRegionManager(), clang::ento::SValBuilder::makeArrayIndex(), and clang::ento::RegionAndSymbolInvalidationTraits::setTrait().
Referenced by tryToInvalidateFReadBufferByElements().
|
static |
Definition at line 2060 of file StreamChecker.cpp.
References D, clang::IdentifierTable::get(), clang::TranslationUnitDecl::getASTContext(), clang::QualType::getCanonicalType(), clang::ASTContext::getFILEType(), clang::ASTContext::getPointerType(), clang::ASTContext::getSourceManager(), clang::ASTContext::Idents, clang::QualType::isNull(), clang::DeclContext::lookup(), and SM.
|
static |
Definition at line 825 of file StreamChecker.cpp.
References clang::ento::SValBuilder::getKnownValue(), and V.
Referenced by tryToInvalidateFReadBufferByElements().
Definition at line 1076 of file StreamChecker.cpp.
Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildFieldReferenceExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::SemaObjC::BuildObjCArrayLiteral(), clang::Sema::canCalleeThrow(), checkArithmeticOnObjCPointer(), clang::Sema::CheckAssignmentConstraints(), clang::Sema::CheckCompareOperands(), checkConditionalObjectPointersCompatibility(), checkConditionalPointerCompatibility(), checkObjCPointerTypesForAssignment(), clang::checkSwiftAsyncErrorBlock(), clang::Sema::CheckUnresolvedMemberAccess(), CompareDerivedToBaseConversions(), clang::ConversionFixItGenerator::compareTypesSimple(), computeCachedProperties(), clang::LinkageComputer::computeTypeLinkageInfo(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseCallingConvCast(), diagnoseListInit(), emitPointerArithmetic(), emitWritebackArg(), encodeTypeForFunctionPointerAuth(), clang::SourceLocExpr::EvaluateInContext(), evaluateLValueAsAllocSize(), clang::Expr::findBoundMemberType(), clang::SemaObjC::FindCompositeObjCPointerType(), clang::CXXNewExpr::getAllocatedType(), clang::CXXDeleteExpr::getDestroyedType(), clang::Decl::getFunctionType(), clang::UnresolvedMemberExpr::getNamingClass(), clang::ASTContext::getObjCEncodingForBlock(), clang::AtomicExpr::getValueType(), clang::ASTContext::getVariableArrayDecayedType(), clang::SemaSwift::handleAsyncAttr(), clang::CompletionContextHandler::handleDeclaration(), handleSentinelAttr(), isDesignatorAtObjectEnd(), clang::Sema::IsFunctionConversion(), clang::SemaOpenMP::isOpenMPCapturedByRef(), IsStructurallyEquivalent(), MarkUsedTemplateParameters(), clang::ASTContext::mergeObjCGCQualifiers(), clang::Sema::MergeTypedefNameDecl(), clang::ASTContext::mergeTypes(), clang::Sema::MergeVarDeclExceptionSpecs(), clang::Sema::PerformImplicitConversion(), clang::PointerType::Profile(), clang::BlockPointerType::Profile(), clang::MemberPointerType::Profile(), clang::ObjCObjectPointerType::Profile(), clang::DependentAddressSpaceType::Profile(), clang::TreeTransform< Derived >::RebuildMemberExpr(), setObjCGCLValueClass(), TryListConversion(), TryReferenceInit(), TryReferenceInitialization(), TryReferenceListInitialization(), TryRefInitWithConversionFunction(), and tryToInvalidateFReadBufferByElements().
|
static |
Definition at line 1088 of file StreamChecker.cpp.
References clang::ento::SValBuilder::getBasicValueFactory(), and clang::ento::BasicValueFactory::getIntValue().
Referenced by tryToInvalidateFReadBufferByElements().
|
static |
Definition at line 1108 of file StreamChecker.cpp.
References clang::C, clang::Call, escapeByStartIndexAndCount(), getKnownValue(), getPointeeType(), clang::CharUnits::getQuantity(), getStartIndex(), clang::ASTContext::getTypeSizeInChars(), and clang::QualType::isNull().