aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/BugReporter.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-03-16 01:07:47 +0000
committerJordan Rose <jordan_rose@apple.com>2013-03-16 01:07:47 +0000
commit9a9fe4068eed2fc72ec985e5ae393fb79a8fb9ad (patch)
tree3f393895684bcd5547ed818d1c7005bb0a9e109e /lib/StaticAnalyzer/Core/BugReporter.cpp
parent2710ed8fd997be04ff447b8be2190f8fb34ac22b (diff)
[analyzer] Don't repeat a bug equivalence class if every report is invalid.
I removed this check in the recursion->iteration commit, but forgot that generatePathDiagnostic may be called multiple times if there are multiple PathDiagnosticConsumers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177214 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/BugReporter.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp
index 1dca2b5206..46108f44ea 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -2114,13 +2114,23 @@ bool GRBugReporter::generatePathDiagnostic(PathDiagnostic& PD,
ArrayRef<BugReport *> &bugReports) {
assert(!bugReports.empty());
+ bool HasValid = false;
SmallVector<const ExplodedNode *, 32> errorNodes;
for (ArrayRef<BugReport*>::iterator I = bugReports.begin(),
- E = bugReports.end();
- I != E; ++I) {
- errorNodes.push_back((*I)->getErrorNode());
+ E = bugReports.end(); I != E; ++I) {
+ if ((*I)->isValid()) {
+ HasValid = true;
+ errorNodes.push_back((*I)->getErrorNode());
+ } else {
+ errorNodes.push_back(0);
+ }
}
+ // If all the reports have been marked invalid by a previous path generation,
+ // we're done.
+ if (!HasValid)
+ return false;
+
typedef PathDiagnosticConsumer::PathGenerationScheme PathGenerationScheme;
PathGenerationScheme ActiveScheme = PC.getGenerationScheme();