]> granicus.if.org Git - clang/commit
[analyzer] RetainCount: A function isn't a CFRetain if it takes no arguments.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 15 Mar 2019 00:26:17 +0000 (00:26 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 15 Mar 2019 00:26:17 +0000 (00:26 +0000)
commit3fd2ce2d376226a37f46071856beb5bcf65d59c4
treee54775b611fdfd695e912c13766f082f14e7c340
parentfa964a3d3fa9be7d6ebb42d4bdfa8492fababf66
[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
lib/Analysis/RetainSummaryManager.cpp
test/Analysis/retain-release.mm