Skip to content

Commit

Permalink
[paramNotNull] Do not add autofix when the location comes form a macro
Browse files Browse the repository at this point in the history
Reviewed By: geralt-encore

Differential Revision: D64535376

fbshipit-source-id: 15bf3a603856236719eb7020d0f17fbd46fa131b
  • Loading branch information
dulmarod authored and facebook-github-bot committed Oct 17, 2024
1 parent 3b5b26d commit 9f98dea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions infer/src/checkers/ParameterNotNullChecked.ml
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,16 @@ module Mem = struct
in
let autofix =
match Config.objc_block_execution_macro with
| Some objc_block_execution_macro ->
| Some objc_block_execution_macro
when Option.is_none (Location.get_macro_file_line_opt loc) ->
let original = Some (F.asprintf "%s(" (Mangled.to_string name)) in
let comma = if List.is_empty args then "" else ", " in
let replacement =
Some
(F.asprintf "%s(%s%s" objc_block_execution_macro (Mangled.to_string name) comma)
in
Some {Jsonbug_j.original; replacement; additional= None}
| None ->
| _ ->
None
in
Reporting.log_issue proc_desc err_log ~ltr ~loc ?autofix ParameterNotNullChecked
Expand Down

0 comments on commit 9f98dea

Please sign in to comment.