clang  6.0.0svn
Functions
MacOSKeychainAPIChecker.cpp File Reference
#include "ClangSACheckers.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/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for MacOSKeychainAPIChecker.cpp:

Go to the source code of this file.

Functions

 REGISTER_MAP_WITH_PROGRAMSTATE (AllocatedData, SymbolRef, MacOSKeychainAPIChecker::AllocationState) static bool isEnclosingFunctionParam(const Expr *E)
 ProgramState traits to store the currently allocated (and not yet freed) symbols. More...
 
static bool isBadDeallocationArgument (const MemRegion *Arg)
 
static SymbolRef getAsPointeeSymbol (const Expr *Expr, CheckerContext &C)
 Given the address expression, retrieve the value it's pointing to. More...
 

Function Documentation

◆ getAsPointeeSymbol()

static SymbolRef getAsPointeeSymbol ( const Expr Expr,
CheckerContext C 
)
static

Given the address expression, retrieve the value it's pointing to.

Assume that value is itself an address, and return the corresponding symbol.

Definition at line 202 of file MacOSKeychainAPIChecker.cpp.

References clang::ento::SymbolManager::addSymbolDependency(), clang::ento::CheckerContext::addTransition(), clang::ento::PathDiagnosticLocation::createBegin(), clang::ento::CheckerContext::emitReport(), clang::ento::CheckerContext::generateNonFatalErrorNode(), clang::CallExpr::getArg(), clang::ento::SVal::getAs(), clang::ento::SVal::getAsLocSymbol(), clang::ento::SVal::getAsRegion(), clang::ento::SVal::getAsSymExpr(), clang::ento::CheckerContext::getASTContext(), clang::ento::StoreManager::getBinding(), clang::ento::CheckerContext::getCalleeDecl(), clang::ento::CheckerContext::getCalleeName(), clang::LocationContext::getDecl(), clang::Decl::getKind(), clang::ento::ExplodedNode::getLocationContext(), clang::ento::CheckerContext::getLocationContext(), clang::CallExpr::getNumArgs(), clang::LocationContext::getParent(), clang::ento::CheckerContext::getSourceManager(), clang::Stmt::getSourceRange(), clang::ento::CheckerContext::getState(), clang::ento::ExplodedNode::getState(), clang::ento::PathDiagnosticLocation::getStmt(), clang::ento::CheckerContext::getStoreManager(), clang::ento::CheckerContext::getSymbolManager(), clang::Expr::IgnoreParenCasts(), isBadDeallocationArgument(), clang::Expr::isNullPointerConstant(), clang::LocationContext::isParentOf(), clang::ento::SVal::isUndef(), clang::Expr::NPC_ValueDependentIsNotNull, clang::ento::ExplodedNode::pred_begin(), clang::ento::ExplodedNode::pred_empty(), SM, State, and X.

◆ isBadDeallocationArgument()

static bool isBadDeallocationArgument ( const MemRegion Arg)
static

Definition at line 193 of file MacOSKeychainAPIChecker.cpp.

Referenced by getAsPointeeSymbol().

◆ REGISTER_MAP_WITH_PROGRAMSTATE()

REGISTER_MAP_WITH_PROGRAMSTATE ( AllocatedData  ,
SymbolRef  ,
MacOSKeychainAPIChecker::AllocationState   
) const

ProgramState traits to store the currently allocated (and not yet freed) symbols.

This is a map from the allocated content symbol to the corresponding AllocationState.

Definition at line 149 of file MacOSKeychainAPIChecker.cpp.