diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-09-14 22:01:32 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-09-14 22:01:32 +0000 |
commit | 06c9cb4d1a29e708f51bce9f7ee5acbe1c3761c3 (patch) | |
tree | 6d46f295727454715e313f5c8c7a40da024d1d0f /lib/Analysis/CFRefCount.cpp | |
parent | 31fddcca28ffb7a569ee8f5d565a856827d92ada (diff) |
Fix: <rdar://problem/5905851> do not report a leak when post-dominated by a call
to a noreturn or panic function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81803 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 8427679316..86edfb946c 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/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. |