aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-10-06 00:43:15 +0000
committerAnna Zaks <ganna@apple.com>2011-10-06 00:43:15 +0000
commit390909c89c98ab1807e15e033a72e975f866fb23 (patch)
tree8936f507a0b5c205821695c89650f6d0718081a3 /lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
parentd1ab1a2dffa66a88e5215216893adcfc658d3e7e (diff)
[analyzer] Remove the dependency on CheckerContext::getStmt() as well as the method itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141262 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp b/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
index b008f97d99..6935c5f1c1 100644
--- a/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
@@ -27,11 +27,12 @@ class ArrayBoundChecker :
public Checker<check::Location> {
mutable llvm::OwningPtr<BuiltinBug> BT;
public:
- void checkLocation(SVal l, bool isLoad, CheckerContext &C) const;
+ void checkLocation(SVal l, bool isLoad, const Stmt* S,
+ CheckerContext &C) const;
};
}
-void ArrayBoundChecker::checkLocation(SVal l, bool isLoad,
+void ArrayBoundChecker::checkLocation(SVal l, bool isLoad, const Stmt* LoadS,
CheckerContext &C) const {
// Check for out of bound array element access.
const MemRegion *R = l.getAsRegion();
@@ -76,7 +77,7 @@ void ArrayBoundChecker::checkLocation(SVal l, bool isLoad,
BugReport *report =
new BugReport(*BT, BT->getDescription(), N);
- report->addRange(C.getStmt()->getSourceRange());
+ report->addRange(LoadS->getSourceRange());
C.EmitReport(report);
return;
}