[self in block] Fix error in choosing variables fmor the domain for reporting

Reviewed By: ngorogiannis

Differential Revision: D18353619

fbshipit-source-id: c4f996269
master
Dulma Churchill 5 years ago committed by Facebook Github Bot
parent 5ea35133af
commit f303c9fa87

@ -80,10 +80,12 @@ let make_trace_elements domain =
let report_issues summary domain =
let weakSelf_opt =
TransferFunctions.Domain.find_first_opt (fun {kind} -> DomainData.is_weak_self kind) domain
TransferFunctions.Domain.filter (fun {kind} -> DomainData.is_weak_self kind) domain
|> TransferFunctions.Domain.choose_opt
in
let self_opt =
TransferFunctions.Domain.find_first_opt (fun {kind} -> DomainData.is_self kind) domain
TransferFunctions.Domain.filter (fun {kind} -> DomainData.is_self kind) domain
|> TransferFunctions.Domain.choose_opt
in
match (weakSelf_opt, self_opt) with
| Some {pvar= weakSelf; loc= weakLoc}, Some {pvar= self; loc= selfLoc} ->

@ -27,6 +27,7 @@
if (strongSelf) {
[strongSelf foo];
int x = self->x; // bug here
[self foo];
}
return 0;
};

@ -1 +1 @@
codetoanalyze/objc/self-in-block/StrongSelf.m, objc_blockSelfInBlockTest::mixSelfWeakSelf_bad_1, 4, MIXED_SELF_WEAKSELF, no_bucket, ERROR, [Using &weakSelf,Using &self]
codetoanalyze/objc/self-in-block/StrongSelf.m, objc_blockSelfInBlockTest::mixSelfWeakSelf_bad_1, 4, MIXED_SELF_WEAKSELF, no_bucket, ERROR, [Using &weakSelf,Using &self,Using &self]

Loading…
Cancel
Save