aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/ArrayBoundChecker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Checker/ArrayBoundChecker.cpp')
-rw-r--r--lib/Checker/ArrayBoundChecker.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Checker/ArrayBoundChecker.cpp b/lib/Checker/ArrayBoundChecker.cpp
index 78c335cb3e..df21595a41 100644
--- a/lib/Checker/ArrayBoundChecker.cpp
+++ b/lib/Checker/ArrayBoundChecker.cpp
@@ -24,9 +24,9 @@ class ArrayBoundChecker :
public CheckerVisitor<ArrayBoundChecker> {
BuiltinBug *BT;
public:
- ArrayBoundChecker() : BT(0) {}
- static void *getTag();
- void VisitLocation(CheckerContext &C, const Stmt *S, SVal l);
+ ArrayBoundChecker() : BT(0) {}
+ static void *getTag() { static int x = 0; return &x; }
+ void visitLocation(CheckerContext &C, const Stmt *S, SVal l);
};
}
@@ -34,11 +34,7 @@ void clang::RegisterArrayBoundChecker(GRExprEngine &Eng) {
Eng.registerCheck(new ArrayBoundChecker());
}
-void *ArrayBoundChecker::getTag() {
- static int x = 0; return &x;
-}
-
-void ArrayBoundChecker::VisitLocation(CheckerContext &C, const Stmt *S, SVal l){
+void ArrayBoundChecker::visitLocation(CheckerContext &C, const Stmt *S, SVal l){
// Check for out of bound array element access.
const MemRegion *R = l.getAsRegion();
if (!R)