Skip to content

Commit

Permalink
[selfInBlock] Add autofix info for Mixed_Self_Weakself
Browse files Browse the repository at this point in the history
Summary: We add the fields original and replacement to the report to specify how to automatically fix this issue.

Reviewed By: martintrojer, ngorogiannis

Differential Revision: D62581375

fbshipit-source-id: c58b1741135b2adb7008c912411f4f13a109cc68
  • Loading branch information
dulmarod authored and facebook-github-bot committed Sep 13, 2024
1 parent 8726999 commit 4c67d00
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions infer/src/checkers/SelfInBlock.ml
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,10 @@ let report_mix_self_weakself_issues proc_desc err_log domain (weakSelf : DomainD
Location.pp self.loc
in
let ltr = make_trace_use_self_weakself domain in
Reporting.log_issue proc_desc err_log ~ltr ~loc:self.loc SelfInBlock IssueType.mixed_self_weakself
message
let to_string element = Mangled.to_string (Pvar.get_name element.DomainData.pvar) in
let autofix = {Jsonbug_j.original= to_string self; replacement= to_string weakSelf} in
Reporting.log_issue proc_desc err_log ~ltr ~loc:self.loc ~autofix SelfInBlock
IssueType.mixed_self_weakself message


let report_weakself_in_no_escape_block_issues proc_desc err_log domain (weakSelf : DomainData.t)
Expand Down

0 comments on commit 4c67d00

Please sign in to comment.