diff options
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp index daec418..34425e3 100644 --- a/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp @@ -20,9 +20,9 @@ #include "ClangSACheckers.h" #include "clang/AST/EvaluatedExprVisitor.h" -#include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h" -#include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h" +#include "clang/StaticAnalyzer/Core/Checker.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h" #include "llvm/ADT/SmallVector.h" using namespace clang; @@ -44,18 +44,18 @@ public: BugReporter &BR) const; void CheckMallocArgument( - llvm::SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, + SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, const Expr *TheArgument, ASTContext &Context) const; void OutputPossibleOverflows( - llvm::SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, + SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, const Decl *D, BugReporter &BR, AnalysisManager &mgr) const; }; } // end anonymous namespace void MallocOverflowSecurityChecker::CheckMallocArgument( - llvm::SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, + SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, const Expr *TheArgument, ASTContext &Context) const { @@ -111,7 +111,7 @@ namespace { class CheckOverflowOps : public EvaluatedExprVisitor<CheckOverflowOps> { public: - typedef llvm::SmallVectorImpl<MallocOverflowCheck> theVecType; + typedef SmallVectorImpl<MallocOverflowCheck> theVecType; private: theVecType &toScanFor; @@ -197,7 +197,7 @@ private: // detect the most blatent cases of overflow and educate the // programmer. void MallocOverflowSecurityChecker::OutputPossibleOverflows( - llvm::SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, + SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, const Decl *D, BugReporter &BR, AnalysisManager &mgr) const { // By far the most common case: nothing to check. if (PossibleMallocOverflows.empty()) @@ -230,13 +230,13 @@ void MallocOverflowSecurityChecker::checkASTCodeBody(const Decl *D, return; // A list of variables referenced in possibly overflowing malloc operands. - llvm::SmallVector<MallocOverflowCheck, 2> PossibleMallocOverflows; + SmallVector<MallocOverflowCheck, 2> PossibleMallocOverflows; for (CFG::iterator it = cfg->begin(), ei = cfg->end(); it != ei; ++it) { CFGBlock *block = *it; for (CFGBlock::iterator bi = block->begin(), be = block->end(); bi != be; ++bi) { - if (const CFGStmt *CS = bi->getAs<CFGStmt>()) { + if (Optional<CFGStmt> CS = bi->getAs<CFGStmt>()) { if (const CallExpr *TheCall = dyn_cast<CallExpr>(CS->getStmt())) { // Get the callee. const FunctionDecl *FD = TheCall->getDirectCallee(); |