#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"
usingnamespaceclang;
usingnamespaceento;
namespace {
class InvalidPtrChecker
: public Checker<check::Location, check::BeginFunction, check::PostCall> { … };
}
REGISTER_SET_WITH_PROGRAMSTATE(…) …
REGISTER_TRAIT_WITH_PROGRAMSTATE(…) …
REGISTER_SET_WITH_PROGRAMSTATE(…) …
REGISTER_MAP_WITH_PROGRAMSTATE(…) …
const NoteTag *InvalidPtrChecker::createEnvInvalidationNote(
CheckerContext &C, ProgramStateRef State, StringRef FunctionName) const { … }
void InvalidPtrChecker::EnvpInvalidatingCall(const CallEvent &Call,
CheckerContext &C) const { … }
void InvalidPtrChecker::postPreviousReturnInvalidatingCall(
const CallEvent &Call, CheckerContext &C) const { … }
static const MemRegion *findInvalidatedSymbolicBase(ProgramStateRef State,
const MemRegion *Reg) { … }
void InvalidPtrChecker::checkPostCall(const CallEvent &Call,
CheckerContext &C) const { … }
void InvalidPtrChecker::checkBeginFunction(CheckerContext &C) const { … }
void InvalidPtrChecker::checkLocation(SVal Loc, bool isLoad, const Stmt *S,
CheckerContext &C) const { … }
void ento::registerInvalidPtrChecker(CheckerManager &Mgr) { … }
bool ento::shouldRegisterInvalidPtrChecker(const CheckerManager &) { … }