diff options
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp b/lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp index 5268bbf5562e7..f4c0edbab3f0a 100644 --- a/lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp @@ -55,7 +55,7 @@ public: } }; -class DivisionBRVisitor : public BugReporterVisitorImpl<DivisionBRVisitor> { +class DivisionBRVisitor : public BugReporterVisitor { private: SymbolRef ZeroSymbol; const StackFrameContext *SFC; @@ -85,7 +85,7 @@ class TestAfterDivZeroChecker public: void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const; void checkBranchCondition(const Stmt *Condition, CheckerContext &C) const; - void checkEndFunction(CheckerContext &C) const; + void checkEndFunction(const ReturnStmt *RS, CheckerContext &C) const; void setDivZeroMap(SVal Var, CheckerContext &C) const; bool hasDivZeroMap(SVal Var, const CheckerContext &C) const; bool isZero(SVal S, CheckerContext &C) const; @@ -114,8 +114,7 @@ DivisionBRVisitor::VisitNode(const ExplodedNode *Succ, const ExplodedNode *Pred, if (!E) return nullptr; - ProgramStateRef State = Succ->getState(); - SVal S = State->getSVal(E, Succ->getLocationContext()); + SVal S = Succ->getSVal(E); if (ZeroSymbol == S.getAsSymbol() && SFC == Succ->getStackFrame()) { Satisfied = true; @@ -181,7 +180,8 @@ void TestAfterDivZeroChecker::reportBug(SVal Val, CheckerContext &C) const { } } -void TestAfterDivZeroChecker::checkEndFunction(CheckerContext &C) const { +void TestAfterDivZeroChecker::checkEndFunction(const ReturnStmt *RS, + CheckerContext &C) const { ProgramStateRef State = C.getState(); DivZeroMapTy DivZeroes = State->get<DivZeroMap>(); |