Skip to content
Snippets Groups Projects
Commit ee128546 authored by Devin Coughlin's avatar Devin Coughlin
Browse files

[analyzer] Include comment mistakenly left out of r261243. NFC.

It explains why we can't just synthesize bodies of setters in BodyFarm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261248 91177308-0d34-0410-b5e6-96231b3b80d8
parent 9bf05a90
No related branches found
No related tags found
No related merge requests found
...@@ -498,6 +498,14 @@ Stmt *BodyFarm::getBody(const ObjCMethodDecl *D) { ...@@ -498,6 +498,14 @@ Stmt *BodyFarm::getBody(const ObjCMethodDecl *D) {
return nullptr; return nullptr;
// For now, we only synthesize getters. // 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) if (D->param_size() != 0)
return nullptr; return nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment