diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-11 17:50:35 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-11 17:50:35 +0000 |
commit | c374cd978abdeb289d360426129886f6e354a459 (patch) | |
tree | 679a363dbe680bbcc19cca94b53a1941a2db31e0 /lib/Frontend/RewriteObjC.cpp | |
parent | 199c3d6cd16aebbb9c7f0d42af9d922c9628bf70 (diff) |
Fixup rewrite of ivars accessed via an explicit object
in a function. Fixes radar 7522803.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93159 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteObjC.cpp')
-rw-r--r-- | lib/Frontend/RewriteObjC.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp index 3000d77605..28f79aa10a 100644 --- a/lib/Frontend/RewriteObjC.cpp +++ b/lib/Frontend/RewriteObjC.cpp @@ -1235,8 +1235,9 @@ Stmt *RewriteObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV, // Explicit ivar refs need to have a cast inserted. // FIXME: consider sharing some of this code with the code above. - if (const PointerType *pType = IV->getBase()->getType()->getAs<PointerType>()) { - ObjCInterfaceType *iFaceDecl = dyn_cast<ObjCInterfaceType>(pType->getPointeeType()); + if (IV->isArrow()) { + ObjCInterfaceType *iFaceDecl = + dyn_cast<ObjCInterfaceType>(BaseExpr->getType()->getPointeeType()); // lookup which class implements the instance variable. ObjCInterfaceDecl *clsDeclared = 0; iFaceDecl->getDecl()->lookupInstanceVariable(D->getIdentifier(), |