зеркало из https://github.com/microsoft/clang-1.git
'self.myIvar = nil' (properties) only releases myIvar when the property has kind 'assign'. This fixes <rdar://problem/6380411>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60717 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
b79c01ea32
Коммит
2c615660ec
|
@ -73,8 +73,11 @@ static bool scan_ivar_release(Stmt* S, ObjCIvarDecl* ID,
|
|||
if(ObjCPropertyRefExpr* PRE =
|
||||
dyn_cast<ObjCPropertyRefExpr>(BO->getLHS()->IgnoreParenCasts()))
|
||||
if(PRE->getProperty() == PD)
|
||||
if(BO->getRHS()->isNullPointerConstant(Ctx))
|
||||
return true;
|
||||
if(BO->getRHS()->isNullPointerConstant(Ctx)) {
|
||||
// This is only a 'release' if the property kind is not
|
||||
// 'assign'.
|
||||
return PD->getSetterKind() != ObjCPropertyDecl::Assign;;
|
||||
}
|
||||
|
||||
// Recurse to children.
|
||||
for (Stmt::child_iterator I = S->child_begin(), E= S->child_end(); I!=E; ++I)
|
||||
|
|
Загрузка…
Ссылка в новой задаче