aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp
index 916977c10c0c..614a2b2e4ec7 100644
--- a/clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp
@@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//
-#include "Taint.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
+#include "clang/StaticAnalyzer/Checkers/Taint.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
@@ -22,27 +22,15 @@ using namespace ento;
using namespace taint;
namespace {
-class TaintTesterChecker : public Checker< check::PostStmt<Expr> > {
-
- mutable std::unique_ptr<BugType> BT;
- void initBugType() const;
-
- /// Given a pointer argument, get the symbol of the value it contains
- /// (points to).
- SymbolRef getPointedToSymbol(CheckerContext &C,
- const Expr* Arg,
- bool IssueWarning = true) const;
+class TaintTesterChecker : public Checker<check::PostStmt<Expr>> {
+ std::unique_ptr<BugType> BT =
+ std::make_unique<BugType>(this, "Tainted data", "General");
public:
void checkPostStmt(const Expr *E, CheckerContext &C) const;
};
}
-inline void TaintTesterChecker::initBugType() const {
- if (!BT)
- BT.reset(new BugType(this, "Tainted data", "General"));
-}
-
void TaintTesterChecker::checkPostStmt(const Expr *E,
CheckerContext &C) const {
ProgramStateRef State = C.getState();
@@ -51,7 +39,6 @@ void TaintTesterChecker::checkPostStmt(const Expr *E,
if (isTainted(State, E, C.getLocationContext())) {
if (ExplodedNode *N = C.generateNonFatalErrorNode()) {
- initBugType();
auto report = std::make_unique<PathSensitiveBugReport>(*BT, "tainted", N);
report->addRange(E->getSourceRange());
C.emitReport(std::move(report));