forked from OSchip/llvm-project
[analyzer] Include comment mistakenly left out of r261243. NFC.
It explains why we can't just synthesize bodies of setters in BodyFarm. llvm-svn: 261248
This commit is contained in:
parent
4152f522aa
commit
ef3697e093
|
@ -498,6 +498,14 @@ Stmt *BodyFarm::getBody(const ObjCMethodDecl *D) {
|
|||
return nullptr;
|
||||
|
||||
// For now, we only synthesize getters.
|
||||
// Synthesizing setters would cause false negatives in the
|
||||
// RetainCountChecker because the method body would bind the parameter
|
||||
// to an instance variable, causing it to escape. This would prevent
|
||||
// warning in the following common scenario:
|
||||
//
|
||||
// id foo = [[NSObject alloc] init];
|
||||
// self.foo = foo; // We should warn that foo leaks here.
|
||||
//
|
||||
if (D->param_size() != 0)
|
||||
return nullptr;
|
||||
|
||||
|
|
Loading…
Reference in New Issue