forked from OSchip/llvm-project
Objective-C ARC. Fixes a crash when checking for 'weak' propery
whose base is not an expression. rdar://19053620 llvm-svn: 222570
This commit is contained in:
parent
6f3150a7d2
commit
ac1c5120c6
|
@ -176,6 +176,8 @@ void FunctionScopeInfo::markSafeWeakUse(const Expr *E) {
|
|||
// Has this weak object been seen before?
|
||||
FunctionScopeInfo::WeakObjectUseMap::iterator Uses;
|
||||
if (const ObjCPropertyRefExpr *RefExpr = dyn_cast<ObjCPropertyRefExpr>(E)) {
|
||||
if (!RefExpr->isObjectReceiver())
|
||||
return;
|
||||
if (isa<OpaqueValueExpr>(RefExpr->getBase()))
|
||||
Uses = WeakObjectUses.find(WeakObjectProfileTy(RefExpr));
|
||||
else {
|
||||
|
|
|
@ -425,3 +425,17 @@ void doubleLevelAccessIvar(Test *a, Test *b) {
|
|||
}
|
||||
@end
|
||||
|
||||
// rdar://19053620
|
||||
@interface NSNull
|
||||
+ (NSNull *)null;
|
||||
@end
|
||||
|
||||
@interface INTF @end
|
||||
|
||||
@implementation INTF
|
||||
- (void) Meth : (id) data
|
||||
{
|
||||
data = data ?: NSNull.null;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in New Issue