summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
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
commit5f37643de173dc9c63b9ed009d067250361b08dc (patch)
tree8487a36bc4087e659e965444cb67d3ffea4fc25f /clang/lib/StaticAnalyzer
parent9569c7625a7dd97b0ccbefd2d17f4b858264a60f (diff)
downloadbcm5719-llvm-5f37643de173dc9c63b9ed009d067250361b08dc.tar.gz
bcm5719-llvm-5f37643de173dc9c63b9ed009d067250361b08dc.zip
[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) llvm-svn: 171769
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
index d326067e535..d2f27f53e71 100644
--- a/clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud