Before this commit, there were two alpha checkers that used different algorithms/logic for detecting out of bounds memory access: the old `alpha.security.ArrayBound` and the experimental, more complex `alpha.security.ArrayBoundV2`. After lots of quality improvement commits ArrayBoundV2 is now stable enough to be moved out of the alpha stage. As indexing (and dereference) are common operations, it still produces a significant amount of false positives, but not much more than e.g. `core.NullDereference` or `core.UndefinedBinaryOperatorResult`, so it should be acceptable as a non-`core` checker. At this point `alpha.security.ArrayBound` became obsolete (there is a better tool for the same task), so I'm removing it from the codebase. With this I can eliminate the ugly "V2" version mark almost everywhere and rename `alpha.security.ArrayBoundV2` to `security.ArrayBound`. (The version mark is preserved in the filename "ArrayBoundCheckerV2", to ensure a clear git history. I'll rename it to "ArrayBoundChecker.cpp" in a separate commit.) This commit adapts the unit tests of `alpha.security.ArrayBound` to testing the new `security.ArrayBound` (= old ArrayBoundV2). Currently the names of the test files are very haphazard, I'll probably create a separate followup commit that consolidates this.
150 lines
4.7 KiB
Plaintext
150 lines
4.7 KiB
Plaintext
static_library("Checkers") {
|
|
output_name = "clangStaticAnalyzerCheckers"
|
|
configs += [ "//llvm/utils/gn/build:clang_code" ]
|
|
deps = [
|
|
"//clang/include/clang/StaticAnalyzer/Checkers",
|
|
"//clang/lib/AST",
|
|
"//clang/lib/ASTMatchers",
|
|
"//clang/lib/Analysis",
|
|
"//clang/lib/Basic",
|
|
"//clang/lib/Lex",
|
|
"//clang/lib/StaticAnalyzer/Core",
|
|
"//llvm/lib/Support",
|
|
"//llvm/lib/TargetParser",
|
|
]
|
|
include_dirs = [ "." ]
|
|
sources = [
|
|
"AnalysisOrderChecker.cpp",
|
|
"AnalyzerStatsChecker.cpp",
|
|
"ArrayBoundCheckerV2.cpp",
|
|
"BasicObjCFoundationChecks.cpp",
|
|
"BitwiseShiftChecker.cpp",
|
|
"BlockInCriticalSectionChecker.cpp",
|
|
"BoolAssignmentChecker.cpp",
|
|
"BuiltinFunctionChecker.cpp",
|
|
"CStringChecker.cpp",
|
|
"CStringSyntaxChecker.cpp",
|
|
"CXXDeleteChecker.cpp",
|
|
"CXXSelfAssignmentChecker.cpp",
|
|
"CallAndMessageChecker.cpp",
|
|
"CastSizeChecker.cpp",
|
|
"CastToStructChecker.cpp",
|
|
"CastValueChecker.cpp",
|
|
"CheckObjCDealloc.cpp",
|
|
"CheckObjCInstMethSignature.cpp",
|
|
"CheckPlacementNew.cpp",
|
|
"CheckSecuritySyntaxOnly.cpp",
|
|
"CheckerDocumentation.cpp",
|
|
"ChrootChecker.cpp",
|
|
"CloneChecker.cpp",
|
|
"ContainerModeling.cpp",
|
|
"ConversionChecker.cpp",
|
|
"DeadStoresChecker.cpp",
|
|
"DebugCheckers.cpp",
|
|
"DebugContainerModeling.cpp",
|
|
"DebugIteratorModeling.cpp",
|
|
"DereferenceChecker.cpp",
|
|
"DirectIvarAssignment.cpp",
|
|
"DivZeroChecker.cpp",
|
|
"DynamicTypeChecker.cpp",
|
|
"DynamicTypePropagation.cpp",
|
|
"EnumCastOutOfRangeChecker.cpp",
|
|
"ErrnoChecker.cpp",
|
|
"ErrnoModeling.cpp",
|
|
"ErrnoTesterChecker.cpp",
|
|
"ExprInspectionChecker.cpp",
|
|
"FixedAddressChecker.cpp",
|
|
"FuchsiaHandleChecker.cpp",
|
|
"GCDAntipatternChecker.cpp",
|
|
"GTestChecker.cpp",
|
|
"GenericTaintChecker.cpp",
|
|
"InnerPointerChecker.cpp",
|
|
"InvalidatedIteratorChecker.cpp",
|
|
"Iterator.cpp",
|
|
"IteratorModeling.cpp",
|
|
"IteratorRangeChecker.cpp",
|
|
"IvarInvalidationChecker.cpp",
|
|
"LLVMConventionsChecker.cpp",
|
|
"LocalizationChecker.cpp",
|
|
"MIGChecker.cpp",
|
|
"MPI-Checker/MPIBugReporter.cpp",
|
|
"MPI-Checker/MPIChecker.cpp",
|
|
"MPI-Checker/MPIFunctionClassifier.cpp",
|
|
"MacOSKeychainAPIChecker.cpp",
|
|
"MacOSXAPIChecker.cpp",
|
|
"MallocChecker.cpp",
|
|
"MallocSizeofChecker.cpp",
|
|
"MismatchedIteratorChecker.cpp",
|
|
"MmapWriteExecChecker.cpp",
|
|
"MoveChecker.cpp",
|
|
"NSAutoreleasePoolChecker.cpp",
|
|
"NSErrorChecker.cpp",
|
|
"NoOwnershipChangeVisitor.cpp",
|
|
"NoReturnFunctionChecker.cpp",
|
|
"NonNullParamChecker.cpp",
|
|
"NonnullGlobalConstantsChecker.cpp",
|
|
"NullabilityChecker.cpp",
|
|
"NumberObjectConversionChecker.cpp",
|
|
"OSObjectCStyleCast.cpp",
|
|
"ObjCAtSyncChecker.cpp",
|
|
"ObjCAutoreleaseWriteChecker.cpp",
|
|
"ObjCContainersASTChecker.cpp",
|
|
"ObjCContainersChecker.cpp",
|
|
"ObjCMissingSuperCallChecker.cpp",
|
|
"ObjCPropertyChecker.cpp",
|
|
"ObjCSelfInitChecker.cpp",
|
|
"ObjCSuperDeallocChecker.cpp",
|
|
"ObjCUnusedIVarsChecker.cpp",
|
|
"PaddingChecker.cpp",
|
|
"PointerArithChecker.cpp",
|
|
"PointerSubChecker.cpp",
|
|
"PthreadLockChecker.cpp",
|
|
"PutenvStackArrayChecker.cpp",
|
|
"RetainCountChecker/RetainCountChecker.cpp",
|
|
"RetainCountChecker/RetainCountDiagnostics.cpp",
|
|
"ReturnPointerRangeChecker.cpp",
|
|
"ReturnUndefChecker.cpp",
|
|
"ReturnValueChecker.cpp",
|
|
"RunLoopAutoreleaseLeakChecker.cpp",
|
|
"STLAlgorithmModeling.cpp",
|
|
"SetgidSetuidOrderChecker.cpp",
|
|
"SimpleStreamChecker.cpp",
|
|
"SmartPtrChecker.cpp",
|
|
"SmartPtrModeling.cpp",
|
|
"StackAddrEscapeChecker.cpp",
|
|
"StdLibraryFunctionsChecker.cpp",
|
|
"StdVariantChecker.cpp",
|
|
"StreamChecker.cpp",
|
|
"StringChecker.cpp",
|
|
"Taint.cpp",
|
|
"TaintTesterChecker.cpp",
|
|
"TestAfterDivZeroChecker.cpp",
|
|
"TraversalChecker.cpp",
|
|
"TrustNonnullChecker.cpp",
|
|
"TrustReturnsNonnullChecker.cpp",
|
|
"UndefBranchChecker.cpp",
|
|
"UndefCapturedBlockVarChecker.cpp",
|
|
"UndefResultChecker.cpp",
|
|
"UndefinedArraySubscriptChecker.cpp",
|
|
"UndefinedAssignmentChecker.cpp",
|
|
"UndefinedNewArraySizeChecker.cpp",
|
|
"UninitializedObject/UninitializedObjectChecker.cpp",
|
|
"UninitializedObject/UninitializedPointee.cpp",
|
|
"UnixAPIChecker.cpp",
|
|
"UnreachableCodeChecker.cpp",
|
|
"VLASizeChecker.cpp",
|
|
"ValistChecker.cpp",
|
|
"VforkChecker.cpp",
|
|
"VirtualCallChecker.cpp",
|
|
"WebKit/ASTUtils.cpp",
|
|
"WebKit/MemoryUnsafeCastChecker.cpp",
|
|
"WebKit/PtrTypesSemantics.cpp",
|
|
"WebKit/RawPtrRefCallArgsChecker.cpp",
|
|
"WebKit/RawPtrRefLocalVarsChecker.cpp",
|
|
"WebKit/RawPtrRefMemberChecker.cpp",
|
|
"WebKit/RefCntblBaseVirtualDtorChecker.cpp",
|
|
"WebKit/UncountedLambdaCapturesChecker.cpp",
|
|
"cert/InvalidPtrChecker.cpp",
|
|
]
|
|
}
|