summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-11-25 21:40:22 +0000
committerTed Kremenek <kremenek@apple.com>2009-11-25 21:40:22 +0000
commitacdc817ed9a8311bb93dbb44c05c702beb89ee26 (patch)
tree40ded528753cba86b46346e4663d86bd8588287a /clang/lib/Analysis/GRExprEngine.cpp
parent44df27e964a3fd02d15f056d08b8261143262208 (diff)
downloadbcm5719-llvm-acdc817ed9a8311bb93dbb44c05c702beb89ee26.tar.gz
bcm5719-llvm-acdc817ed9a8311bb93dbb44c05c702beb89ee26.zip
When dispatching to Checker objects in GRExprEngine::CheckerVisit(),
only stop processing the checkers after all the nodes for a current check have been processed. This (I believe) handles the case where PredSet (the input nodes) contains more than one node due to state bifurcation. Zhongxing: can you review this? llvm-svn: 89882
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index 11ea5f8f3f9..403126c471a 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/lib/Analysis/GRExprEngine.cpp
@@ -118,6 +118,7 @@ bool GRExprEngine::CheckerVisit(Stmt *S, ExplodedNodeSet &Dst,
ExplodedNodeSet Tmp;
ExplodedNodeSet *PrevSet = &Src;
+ bool stopProcessingAfterCurrentChecker = false;
for (CheckersOrdered::iterator I=Checkers.begin(),E=Checkers.end(); I!=E; ++I)
{
@@ -127,20 +128,27 @@ bool GRExprEngine::CheckerVisit(Stmt *S, ExplodedNodeSet &Dst,
CurrSet->clear();
void *tag = I->first;
Checker *checker = I->second;
-
+
for (ExplodedNodeSet::iterator NI = PrevSet->begin(), NE = PrevSet->end();
NI != NE; ++NI) {
// FIXME: Halting evaluation of the checkers is something we may
- // not support later. The design is still evolving.
+ // not support later. The design is still evolving.
if (checker->GR_Visit(*CurrSet, *Builder, *this, S, *NI,
tag, isPrevisit)) {
if (CurrSet != &Dst)
Dst.insert(*CurrSet);
- return true;
+
+ stopProcessingAfterCurrentChecker = true;
+ continue;
}
+ assert(stopProcessingAfterCurrentChecker == false &&
+ "Inconsistent setting of 'stopProcessingAfterCurrentChecker'");
}
+
+ if (stopProcessingAfterCurrentChecker)
+ return true;
- // Update which NodeSet is the current one.
+ // Continue on to the next checker. Update the current NodeSet.
PrevSet = CurrSet;
}
OpenPOWER on IntegriCloud