diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-11 19:45:13 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-11 19:45:13 +0000 |
commit | 1790c975e76d9cb267b78b190d2aaaf62060a4c1 (patch) | |
tree | e38cdfcdcb7dfab153ea804c9fe67ed9c5e94d71 /clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp | |
parent | 32bd3a1e9a05f6d2ea8bb9d1d666e20d12091edb (diff) | |
download | bcm5719-llvm-1790c975e76d9cb267b78b190d2aaaf62060a4c1.tar.gz bcm5719-llvm-1790c975e76d9cb267b78b190d2aaaf62060a4c1.zip |
[analyzer] Add 'isLoad' parameter in Checker::visitLocation() to conveniently distinguish between loads/stores.
llvm-svn: 123261
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp index 13e628bcb1a..d52427bf9d6 100644 --- a/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp +++ b/clang/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) |