]> granicus.if.org Git - clang/commit
[analyzer] DeallocChecker: Don't warn about directly-set IBOutlet ivars on macOS
authorDevin Coughlin <dcoughlin@apple.com>
Wed, 12 Oct 2016 23:57:05 +0000 (23:57 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Wed, 12 Oct 2016 23:57:05 +0000 (23:57 +0000)
commit36a5831534de7715ca48235aaa5a991d1ba55f08
tree04e36c08433105c91314f176d87d7345becc579a
parent959f88aa51b74a58e94df40636b27fdbd85d4884
[analyzer] DeallocChecker: Don't warn about directly-set IBOutlet ivars on macOS

On macOS (but not iOS), if an ObjC property has no setter, the nib-loading code
for an IBOutlet is documented as directly setting the backing ivar without
retaining the value -- even if the property is 'retain'.

This resulted in false positives from the DeallocChecker for code that did not
release such ivars in -dealloc.

To avoid these false positives, treat IBOutlet ivars that back a property
without a setter as having an unknown release requirement in macOS.

rdar://problem/28507353

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284084 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp
test/Analysis/DeallocMissingRelease.m