aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-07-27 19:07:32 +0000
committerAnna Zaks <ganna@apple.com>2012-07-27 19:07:32 +0000
commit6fbe0317aa38dbac22a29f7519c52db838aa1990 (patch)
tree71b5ede06428007835d71212127dfa2113a251d7
parent3b198a97d2aceb1620483586c8c3cabf9e5e8078 (diff)
[analyzer] Address Jordan's and Fariborz's review of r160768.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160883 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h8
-rw-r--r--test/Analysis/inlining/InlineObjCClassMethod.m1
2 files changed, 5 insertions, 4 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
index a366c07481..2661e62403 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
@@ -652,17 +652,17 @@ public:
// getting the parameters). Currently, this gets called 3 times during
// inlining.
virtual const Decl *getRuntimeDefinition() const {
-
const ObjCMessageExpr *E = getOriginExpr();
+ assert(E);
+
if (E->isInstanceMessage()) {
return 0;
} else {
- // This is a calss method.
+ // This is a class method.
// If we have type info for the receiver class, we are calling via
// class name.
- if (ObjCInterfaceDecl *IDecl = E->getReceiverInterface()) {
+ if (ObjCInterfaceDecl *IDecl = E->getReceiverInterface())
return LookupClassMethodDefinition(E->getSelector(), IDecl);
- }
}
return 0;
diff --git a/test/Analysis/inlining/InlineObjCClassMethod.m b/test/Analysis/inlining/InlineObjCClassMethod.m
index 0765251550..8c0e733fc5 100644
--- a/test/Analysis/inlining/InlineObjCClassMethod.m
+++ b/test/Analysis/inlining/InlineObjCClassMethod.m
@@ -114,6 +114,7 @@ int foo() {
// False negative.
// ObjC class method call through a decl with a known type.
// We should be able to track the type of currentClass and inline this call.
+// Note, [self class] could be a subclass. Do we still want to inline here?
@interface MyClassKT : NSObject
@end
@interface MyClassKT (MyCatKT)