aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp b/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp
index 3f6549de56b0..f3f4dce8b17d 100644
--- a/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp
@@ -28,8 +28,8 @@ namespace {
class UndefResultChecker
: public Checker< check::PostStmt<BinaryOperator> > {
- mutable OwningPtr<BugType> BT;
-
+ mutable std::unique_ptr<BugType> BT;
+
public:
void checkPostStmt(const BinaryOperator *B, CheckerContext &C) const;
};
@@ -55,11 +55,12 @@ void UndefResultChecker::checkPostStmt(const BinaryOperator *B,
return;
if (!BT)
- BT.reset(new BuiltinBug("Result of operation is garbage or undefined"));
+ BT.reset(
+ new BuiltinBug(this, "Result of operation is garbage or undefined"));
SmallString<256> sbuf;
llvm::raw_svector_ostream OS(sbuf);
- const Expr *Ex = NULL;
+ const Expr *Ex = nullptr;
bool isLeft = true;
if (state->getSVal(B->getLHS(), LCtx).isUndef()) {