IdempotentOperationChecker no longer reports errors that are post-dominated by a sink. This fixes some false positives that were flagged because a path was incomplete (usually in a loop).

llvm-svn: 114244
This commit is contained in:
Tom Care 2010-09-18 00:06:34 +00:00
parent af5d63583e
commit 0f99e64305
1 changed files with 3 additions and 0 deletions

View File

@ -364,6 +364,9 @@ void IdempotentOperationChecker::VisitEndAnalysis(ExplodedGraph &G,
BugReporter &BR,
GRExprEngine &Eng) {
BugType *BT = new BugType("Idempotent operation", "Dead code");
// If a sink is present, we may have not seen the complete path.
BT->setSuppressOnSink(true);
// Iterate over the hash to see if we have any paths with definite
// idempotent operations.
for (AssumptionMap::const_iterator i = hash.begin(); i != hash.end(); ++i) {