]> granicus.if.org Git - clang/commit
[analyzer] RetainCount: Ignore annotations on user-made CFRetain wrappers.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 13 Oct 2017 19:10:42 +0000 (19:10 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 13 Oct 2017 19:10:42 +0000 (19:10 +0000)
commit6ac84e99d98cd9d1cd9681f954f005e60f5a6193
tree2306e502651079d36f5a491a4f3bc43758422e44
parent3704be1446b89ed24a034f991ac8c0b7fcb26d9c
[analyzer] RetainCount: Ignore annotations on user-made CFRetain wrappers.

It is not uncommon for the users to make their own wrappers around
CoreFoundation's CFRetain and CFRelease functions that are defensive
against null references. In such cases CFRetain is often incorrectly
marked as CF_RETURNS_RETAINED. Ignore said annotation and treat such
wrappers similarly to the regular CFRetain.

rdar://problem/31699502
Differential Revision: https://reviews.llvm.org/D38877

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315736 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
test/Analysis/retain-release-safe.c [new file with mode: 0644]