aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-03-15 00:26:17 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2019-03-15 00:26:17 +0000
commit3fd2ce2d376226a37f46071856beb5bcf65d59c4 (patch)
treee54775b611fdfd695e912c13766f082f14e7c340 /test/Analysis
parentfa964a3d3fa9be7d6ebb42d4bdfa8492fababf66 (diff)
[analyzer] RetainCount: A function isn't a CFRetain if it takes no arguments.
Don't crash when a function has a name that starts with "CF" and ends with "Retain" but takes 0 arguments. In particular, don't try to treat it as if it returns its first argument. These problems are inevitable because the checker is naming-convention-based, but at least we shouldn't crash. Differential Revision: https://reviews.llvm.org/D59123 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356223 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/retain-release.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Analysis/retain-release.mm b/test/Analysis/retain-release.mm
index 97ea5607d2..ba864f817c 100644
--- a/test/Analysis/retain-release.mm
+++ b/test/Analysis/retain-release.mm
@@ -503,3 +503,15 @@ void test_cxx_method_escaping(S *s) {
}
}
+
+namespace yet_another_unexpected_signature_crash {
+
+CFTypeRef CFSomethingSomethingRetain();
+CFTypeRef CFSomethingSomethingAutorelease();
+
+void foo() {
+ CFSomethingSomethingRetain(); // no-crash
+ CFSomethingSomethingAutorelease(); // no-crash
+}
+
+}