aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-11 19:45:13 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-11 19:45:13 +0000
commitf7fbbda62705352a53ac3b495a1128946a34ced3 (patch)
treec042c25f9a66e26035ade70033885735ffaa22cf /lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
parent4e97586b804f6132d83cb534f16a5b6a7756e819 (diff)
[analyzer] Add 'isLoad' parameter in Checker::visitLocation() to conveniently distinguish between loads/stores.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123261 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp b/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
index 13e628bcb1..d52427bf9d 100644
--- a/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
@@ -27,7 +27,7 @@ class ArrayBoundChecker :
public:
ArrayBoundChecker() : BT(0) {}
static void *getTag() { static int x = 0; return &x; }
- void visitLocation(CheckerContext &C, const Stmt *S, SVal l);
+ void visitLocation(CheckerContext &C, const Stmt *S, SVal l, bool isLoad);
};
}
@@ -35,7 +35,8 @@ void ento::RegisterArrayBoundChecker(ExprEngine &Eng) {
Eng.registerCheck(new ArrayBoundChecker());
}
-void ArrayBoundChecker::visitLocation(CheckerContext &C, const Stmt *S, SVal l){
+void ArrayBoundChecker::visitLocation(CheckerContext &C, const Stmt *S, SVal l,
+ bool isLoad) {
// Check for out of bound array element access.
const MemRegion *R = l.getAsRegion();
if (!R)