aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-01-07 19:12:56 +0000
committerAnna Zaks <ganna@apple.com>2013-01-07 19:12:56 +0000
commit5879fb3f6d559863c18df7132ee3d5fdb62b6ae5 (patch)
treeafae0bdfc95790f73e7b0687a9edda9c9f7934e4 /lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
parent975b1203baeb04b13cdaa017b7fdd384f5adcad0 (diff)
[analyzer] Fix a false positive in the ivar invalidation checker.
When a property is "inherited" through both a parent class and directly through a protocol, we should not require the child to invalidate it since the backing ivar belongs to the parent class. (Fixes radar://12913734) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp b/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
index d326067e53..d2f27f53e7 100644
--- a/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
@@ -271,7 +271,9 @@ const ObjCIvarDecl *IvarInvalidationChecker::findPropertyBackingIvar(
// Lookup for the synthesized case.
IvarD = Prop->getPropertyIvarDecl();
- if (IvarD) {
+ // We only track the ivars/properties that are defined in the current
+ // class (not the parent).
+ if (IvarD && IvarD->getContainingInterface() == InterfaceD) {
if (TrackedIvars.count(IvarD)) {
return IvarD;
}