diff options
-rw-r--r-- | include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h | 8 | ||||
-rw-r--r-- | test/Analysis/inlining/InlineObjCClassMethod.m | 1 |
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) |