summaryrefslogtreecommitdiffstats
path: root/lib/Analysis/ArrayBoundChecker.cpp
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-12-01 11:08:04 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-12-01 11:08:04 +0000
commit4b08eb6308ca90a6c08e2fc79d100821b1b1f6aa (patch)
tree867cbbe32a66fd7d62dd9ce9df23a23fefdb8290 /lib/Analysis/ArrayBoundChecker.cpp
parent6df2408694f81a03eb8b0e3b013272042233c061 (diff)
downloadFreeBSD-src-4b08eb6308ca90a6c08e2fc79d100821b1b1f6aa.zip
FreeBSD-src-4b08eb6308ca90a6c08e2fc79d100821b1b1f6aa.tar.gz
Update clang to r90226.
Diffstat (limited to 'lib/Analysis/ArrayBoundChecker.cpp')
-rw-r--r--lib/Analysis/ArrayBoundChecker.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Analysis/ArrayBoundChecker.cpp b/lib/Analysis/ArrayBoundChecker.cpp
index 549a22b..3d95ab1 100644
--- a/lib/Analysis/ArrayBoundChecker.cpp
+++ b/lib/Analysis/ArrayBoundChecker.cpp
@@ -20,7 +20,7 @@
using namespace clang;
namespace {
-class VISIBILITY_HIDDEN ArrayBoundChecker :
+class ArrayBoundChecker :
public CheckerVisitor<ArrayBoundChecker> {
BuiltinBug *BT;
public:
@@ -62,8 +62,7 @@ void ArrayBoundChecker::VisitLocation(CheckerContext &C, const Stmt *S, SVal l){
const GRState *StInBound = state->AssumeInBound(Idx, NumElements, true);
const GRState *StOutBound = state->AssumeInBound(Idx, NumElements, false);
if (StOutBound && !StInBound) {
- ExplodedNode *N = C.GenerateNode(S, StOutBound, true);
-
+ ExplodedNode *N = C.GenerateSink(StOutBound);
if (!N)
return;
@@ -80,7 +79,12 @@ void ArrayBoundChecker::VisitLocation(CheckerContext &C, const Stmt *S, SVal l){
new RangedBugReport(*BT, BT->getDescription(), N);
report->addRange(S->getSourceRange());
-
C.EmitReport(report);
+ return;
}
+
+ // Array bound check succeeded. From this point forward the array bound
+ // should always succeed.
+ assert(StInBound);
+ C.addTransition(StInBound);
}
OpenPOWER on IntegriCloud