summaryrefslogtreecommitdiffstats
path: root/clang/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
commit3e0f415d0d17b129919fe1b84750470cc69e1858 (patch)
tree5eb54f6415b8b1cb94b17a069bf77afbfa9c1128 /clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
parentfab289a47da142d2d04c3a8d2a954ce9d4b82c8d (diff)
downloadbcm5719-llvm-3e0f415d0d17b129919fe1b84750470cc69e1858.tar.gz
bcm5719-llvm-3e0f415d0d17b129919fe1b84750470cc69e1858.zip
[analyzer] Remove the dependency on CheckerContext::getStmt() as well as the method itself.
llvm-svn: 141262
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
index b008f97d99e..6935c5f1c19 100644
--- a/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud