]> granicus.if.org Git - clang/commit
[analyzer] Add CIFIlter modeling to DeallocChecker.
authorDevin Coughlin <dcoughlin@apple.com>
Fri, 25 Mar 2016 21:18:22 +0000 (21:18 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Fri, 25 Mar 2016 21:18:22 +0000 (21:18 +0000)
commitfcff7954e1aa04b125a9ed9c39dffdeefcfbb18f
tree65c8aea9833f28f725ef2d83db9b1c6883243e5b
parent62ff4df369222fa99cd9d78cf3ce9edf34c9d753
[analyzer] Add CIFIlter modeling to DeallocChecker.

The -dealloc method in CIFilter is highly unusual in that it will release
instance variables belonging to its *subclasses* if the variable name
starts with "input" or backs a property whose name starts with "input".
Subclasses should not release these ivars in their own -dealloc method --
doing so could result in an over release.

Before this commit, the DeallocChecker would warn about missing releases for
such "input" properties -- which could cause users of the analyzer to add
over releases to silence the warning.

To avoid this, DeallocChecker now treats CIFilter "input-prefixed" ivars
as MustNotReleaseDirectly and so will not require a release. Further, it
will now warn when such an ivar is directly released in -dealloc.

rdar://problem/25364901

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264463 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp
test/Analysis/DeallocMissingRelease.m
test/Analysis/Inputs/system-header-simulator-for-objc-dealloc.h