From 1569ce68681d909594d64f9b056d71f5dd7563bf Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Tue, 1 Dec 2009 11:08:04 +0000 Subject: Update clang to r90226. --- lib/Analysis/ArrayBoundChecker.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/Analysis/ArrayBoundChecker.cpp') diff --git a/lib/Analysis/ArrayBoundChecker.cpp b/lib/Analysis/ArrayBoundChecker.cpp index 549a22bec1727..3d95ab183471b 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 { 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); } -- cgit v1.3