clang
7.0.0
|
#include "ClangSACheckers.h"
#include "InterCheckerAPI.h"
#include "clang/AST/Attr.h"
#include "clang/AST/ParentMap.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.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/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "AllocationState.h"
#include <climits>
#include <utility>
Go to the source code of this file.
Namespaces | |
clang | |
Dataflow Directional Tag Classes. | |
clang::ento | |
clang::ento::allocation_state | |
Macros | |
#define | CASE(ID) case ID: OS << #ID; break; |
#define | REGISTER_CHECKER(name) |
Enumerations | |
enum | AllocationFamily |
enum | ReallocPairKind |
Functions | |
static QualType | getDeepPointeeType (QualType T) |
static bool | treatUnusedNewEscaped (const CXXNewExpr *NE) |
static bool | isKnownDeallocObjCMethodName (const ObjCMethodCall &Call) |
static Optional< bool > | getFreeWhenDoneArg (const ObjCMethodCall &Call) |
static bool | didPreviousFreeFail (ProgramStateRef State, SymbolRef Sym, SymbolRef &RetStatusSymbol) |
Checks if the previous call to free on the given symbol failed - if free failed, returns true. More... | |
static bool | retTrue (const RefState *RS) |
static bool | checkIfNewOrNewArrayFamily (const RefState *RS) |
static SymbolRef | findFailedReallocSymbol (ProgramStateRef currState, ProgramStateRef prevState) |
static bool | isReferenceCountingPointerDestructor (const CXXDestructorDecl *DD) |
ProgramStateRef | clang::ento::allocation_state::markReleased (ProgramStateRef State, SymbolRef Sym, const Expr *Origin) |
#define CASE | ( | ID | ) | case ID: OS << #ID; break; |
#define REGISTER_CHECKER | ( | name | ) |
Definition at line 3090 of file MallocChecker.cpp.
enum AllocationFamily |
Definition at line 43 of file MallocChecker.cpp.
enum ReallocPairKind |
Definition at line 130 of file MallocChecker.cpp.
|
static |
Definition at line 2778 of file MallocChecker.cpp.
References clang::ento::PSK_DirectEscapeOnCall, retTrue(), and State.
|
static |
Checks if the previous call to free on the given symbol failed - if free failed, returns true.
Also, returns the corresponding return value symbol.
Definition at line 1369 of file MallocChecker.cpp.
References clang::ento::ConditionTruthVal::isConstrainedTrue(), and clang::ento::ConstraintManager::isNull().
|
static |
Definition at line 2832 of file MallocChecker.cpp.
Referenced by isReferenceCountingPointerDestructor().
Definition at line 1046 of file MallocChecker.cpp.
References clang::Type::getPointeeType().
Referenced by treatUnusedNewEscaped().
|
static |
Definition at line 1198 of file MallocChecker.cpp.
|
static |
Definition at line 1186 of file MallocChecker.cpp.
References clang::Selector::getNameForSlot(), and clang::ObjCMethodCall::getSelector().
|
static |
Definition at line 2847 of file MallocChecker.cpp.
References findFailedReallocSymbol(), clang::ProgramPoint::getAs(), clang::ento::ProgramStateManager::getCallEventManager(), clang::NamedDecl::getIdentifier(), clang::ProgramPoint::getKind(), clang::ento::ExplodedNode::getLocation(), clang::ento::ExplodedNode::getLocationContext(), clang::LocationContext::getParent(), clang::CXXMethodDecl::getParent(), clang::ento::BugReporterContext::getSourceManager(), clang::ento::ExplodedNode::getState(), clang::ento::BugReporterContext::getStateManager(), clang::ento::PathDiagnosticLocation::getStmt(), clang::LocationContext::isParentOf(), clang::ento::BugReport::markInteresting(), clang::ento::BugReport::markInvalid(), and clang::ProgramPoint::PostImplicitCallKind.
|
static |
Definition at line 2774 of file MallocChecker.cpp.
Referenced by checkIfNewOrNewArrayFamily().
|
static |
Definition at line 1055 of file MallocChecker.cpp.
References clang::CXXNewExpr::getAllocatedType(), clang::Type::getAsCXXRecordDecl(), clang::CXXNewExpr::getConstructExpr(), clang::CXXConstructExpr::getConstructor(), getDeepPointeeType(), clang::CXXNewExpr::getNumPlacementArgs(), clang::Type::getPointeeType(), clang::QualType::isNull(), clang::FunctionDecl::parameters(), and MultiVersioning::Target.