Index: cfe/trunk/lib/Sema/ScopeInfo.cpp =================================================================== --- cfe/trunk/lib/Sema/ScopeInfo.cpp +++ cfe/trunk/lib/Sema/ScopeInfo.cpp @@ -86,11 +86,15 @@ if (BaseProp) { D = getBestPropertyDecl(BaseProp); - const Expr *DoubleBase = BaseProp->getBase(); - if (const OpaqueValueExpr *OVE = dyn_cast(DoubleBase)) - DoubleBase = OVE->getSourceExpr(); + if (BaseProp->isClassReceiver()) + IsExact = true; + else { + const Expr *DoubleBase = BaseProp->getBase(); + if (const OpaqueValueExpr *OVE = dyn_cast(DoubleBase)) + DoubleBase = OVE->getSourceExpr(); - IsExact = DoubleBase->isObjCSelfExpr(); + IsExact = DoubleBase->isObjCSelfExpr(); + } } break; } Index: cfe/trunk/test/SemaObjC/arc-repeated-weak.mm =================================================================== --- cfe/trunk/test/SemaObjC/arc-repeated-weak.mm +++ cfe/trunk/test/SemaObjC/arc-repeated-weak.mm @@ -439,3 +439,15 @@ } @end +// This used to crash in WeakObjectProfileTy::getBaseInfo when getBase() was +// called on an ObjCPropertyRefExpr object whose receiver was an interface. + +@class NSString; +@interface NSBundle ++(NSBundle *)foo; +@property NSString *prop; +@end + +void foo() { + NSString * t = NSBundle.foo.prop; +}