diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2011-04-18 21:16:59 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-04-18 21:16:59 +0000 |
| commit | b107143feddf0f8cfac2fc313b63650d640a49fa (patch) | |
| tree | 4736fc681ea299be954a76f4d7ea5c473fcd995c /clang/lib/AST/ASTContext.cpp | |
| parent | 1ee61a7f3b11cfdc1a787186a3309cba742d57a1 (diff) | |
| download | bcm5719-llvm-b107143feddf0f8cfac2fc313b63650d640a49fa.tar.gz bcm5719-llvm-b107143feddf0f8cfac2fc313b63650d640a49fa.zip | |
Fix a bug in calculation of composite type
of conditional expressions of objc pointer types
where one type is the immediate base type of the
other. // rdar://9296866
llvm-svn: 129718
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index f723f2a8b7b..524a7563e64 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -4963,10 +4963,10 @@ QualType ASTContext::areCommonBaseCompatible( const ObjCObjectType *RHS = Rptr->getObjectType(); const ObjCInterfaceDecl* LDecl = LHS->getInterface(); const ObjCInterfaceDecl* RDecl = RHS->getInterface(); - if (!LDecl || !RDecl) + if (!LDecl || !RDecl || (LDecl == RDecl)) return QualType(); - while ((LDecl = LDecl->getSuperClass())) { + do { LHS = cast<ObjCInterfaceType>(getObjCInterfaceType(LDecl)); if (canAssignObjCInterfaces(LHS, RHS)) { llvm::SmallVector<ObjCProtocolDecl *, 8> Protocols; @@ -4978,7 +4978,7 @@ QualType ASTContext::areCommonBaseCompatible( Result = getObjCObjectPointerType(Result); return Result; } - } + } while ((LDecl = LDecl->getSuperClass())); return QualType(); } |

