diff options
author | Tom Care <tom.care@uqconnect.edu.au> | 2010-09-18 00:06:34 +0000 |
---|---|---|
committer | Tom Care <tom.care@uqconnect.edu.au> | 2010-09-18 00:06:34 +0000 |
commit | 46976384326cb2fa17b75c84c45b44b1210f353a (patch) | |
tree | 659538ec2abc684d85446cae10cafce4cfe23ae1 /lib/Checker | |
parent | c6c8b3355da96bd0519632196b28fe57c5159d39 (diff) |
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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114244 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker')
-rw-r--r-- | lib/Checker/IdempotentOperationChecker.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Checker/IdempotentOperationChecker.cpp b/lib/Checker/IdempotentOperationChecker.cpp index 3dcbea491e..f392a8da82 100644 --- a/lib/Checker/IdempotentOperationChecker.cpp +++ b/lib/Checker/IdempotentOperationChecker.cpp @@ -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) { |