20#include "llvm/ADT/StringRef.h"
26class PointerSubChecker
27 :
public Checker< check::PreStmt<BinaryOperator> > {
28 mutable std::unique_ptr<BugType> BT;
58 if (isa<SymbolicRegion>(BaseLR) || isa<SymbolicRegion>(BaseRR))
63 BT.reset(
new BugType(
this,
"Pointer subtraction"));
64 constexpr llvm::StringLiteral Msg =
65 "Subtraction of two pointers that do not point to the same memory "
66 "chunk may cause incorrect result.";
67 auto R = std::make_unique<PathSensitiveBugReport>(*BT, Msg, N);
69 C.emitReport(std::move(R));
77bool ento::shouldRegisterPointerSubChecker(
const CheckerManager &mgr) {
A builtin binary operation expression such as "x + y" or "x <= y".
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
CHECKER * registerChecker(AT &&... Args)
Used to register checkers.
MemRegion - The root abstract class for all memory regions.
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * getBaseRegion() const
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
const MemRegion * getAsRegion() const