summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-09-14 22:01:32 +0000
committerTed Kremenek <kremenek@apple.com>2009-09-14 22:01:32 +0000
commit4112969df11ef9c24ed69d30797bb5ccc5b016f8 (patch)
treeb89ae0ae058746f5ade16d83413f4cb889fe471a /clang/lib/Analysis/CFRefCount.cpp
parent2898af59dc189e600491a32cc8429adcbc0ad4f4 (diff)
downloadbcm5719-llvm-4112969df11ef9c24ed69d30797bb5ccc5b016f8.tar.gz
bcm5719-llvm-4112969df11ef9c24ed69d30797bb5ccc5b016f8.zip
Fix: <rdar://problem/5905851> do not report a leak when post-dominated by a call
to a noreturn or panic function llvm-svn: 81803
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index 8427679316b..86edfb946cc 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -2216,7 +2216,9 @@ void CFRefCount::RegisterChecks(BugReporter& BR) {
name = "Leak of returned object";
}
+ // Leaks should not be reported if they are post-dominated by a sink.
leakAtReturn = new LeakAtReturn(this, name);
+ leakAtReturn->setSuppressOnSink(true);
BR.Register(leakAtReturn);
// Second, register leaks within a function/method.
@@ -2230,7 +2232,9 @@ void CFRefCount::RegisterChecks(BugReporter& BR) {
name = "Leak";
}
+ // Leaks should not be reported if they are post-dominated by sinks.
leakWithinFunction = new LeakWithinFunction(this, name);
+ leakWithinFunction->setSuppressOnSink(true);
BR.Register(leakWithinFunction);
// Save the reference to the BugReporter.
OpenPOWER on IntegriCloud