Skip to content

Commit

Permalink
[pulse] Remove unused pulse-report-ignore-unknown-java-methods-patter…
Browse files Browse the repository at this point in the history
…ns-reset option

Summary: Remove unused pulse-report-ignore-unknown-java-methods-patterns-reset option

Reviewed By: ngorogiannis

Differential Revision:
D49010181

Privacy Context Container: L1208441

fbshipit-source-id: 8df113d000634d7886900ae53527e633db2308d1
  • Loading branch information
geralt-encore authored and facebook-github-bot committed Sep 20, 2023
1 parent 603522a commit 751cec8
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 77 deletions.
7 changes: 0 additions & 7 deletions infer/man/man1/infer-analyze.txt
Original file line number Diff line number Diff line change
Expand Up @@ -797,13 +797,6 @@ PULSE CHECKER OPTIONS
Maximum number of array elements and structure fields to keep
track of for a given address.

--pulse-report-ignore-unknown-java-methods-patterns +string
On Java, do not report issues that are found on program paths that
contain calls to unknown methods (those without implementation)
unless a) this option isn't passed at all (the default, or with
--pulse-report-ignore-unknown-java-methods-patterns-reset), or b)
all the unknown method names match one of the provided patterns.

--pulse-skip-procedures regex
Regex of procedures that should not be analyzed by Pulse.

Expand Down
12 changes: 0 additions & 12 deletions infer/man/man1/infer-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1410,14 +1410,6 @@ OPTIONS
Report data flows which pass through taint sink procname
See also infer-report(1).

--pulse-report-ignore-unknown-java-methods-patterns +string
On Java, do not report issues that are found on program paths that
contain calls to unknown methods (those without implementation)
unless a) this option isn't passed at all (the default, or with
--pulse-report-ignore-unknown-java-methods-patterns-reset), or b)
all the unknown method names match one of the provided patterns.
See also infer-analyze(1).

--pulse-skip-procedures regex
Regex of procedures that should not be analyzed by Pulse.
See also infer-analyze(1).
Expand Down Expand Up @@ -2768,10 +2760,6 @@ INTERNAL OPTIONS
--pulse-report-flows-to-taint-sink-reset
Cancel the effect of --pulse-report-flows-to-taint-sink.

--pulse-report-ignore-unknown-java-methods-patterns-reset
Set --pulse-report-ignore-unknown-java-methods-patterns to the
empty list.

--pulse-report-issues-for-tests
Activates: Do not suppress any of the issues found by Pulse.
(Conversely: --no-pulse-report-issues-for-tests)
Expand Down
8 changes: 0 additions & 8 deletions infer/man/man1/infer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1410,14 +1410,6 @@ OPTIONS
Report data flows which pass through taint sink procname
See also infer-report(1).

--pulse-report-ignore-unknown-java-methods-patterns +string
On Java, do not report issues that are found on program paths that
contain calls to unknown methods (those without implementation)
unless a) this option isn't passed at all (the default, or with
--pulse-report-ignore-unknown-java-methods-patterns-reset), or b)
all the unknown method names match one of the provided patterns.
See also infer-analyze(1).

--pulse-skip-procedures regex
Regex of procedures that should not be analyzed by Pulse.
See also infer-analyze(1).
Expand Down
17 changes: 0 additions & 17 deletions infer/src/base/Config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2506,15 +2506,6 @@ and pulse_recency_limit =
"Maximum number of array elements and structure fields to keep track of for a given address."


and pulse_report_ignore_unknown_java_methods_patterns =
CLOpt.mk_string_list ~default:[] ~long:"pulse-report-ignore-unknown-java-methods-patterns"
~in_help:InferCommand.[(Analyze, manual_pulse)]
"On Java, do not report issues that are found on program paths that contain calls to unknown \
methods (those without implementation) $(b,unless) a) this option isn't passed at all (the \
default, or with $(b,--pulse-report-ignore-unknown-java-methods-patterns-reset)), or b) all \
the unknown method names match one of the provided patterns."


and pulse_report_flows_from_taint_source =
CLOpt.mk_string_opt ~long:"pulse-report-flows-from-taint-source"
~in_help:InferCommand.[(Report, manual_pulse)]
Expand Down Expand Up @@ -4272,14 +4263,6 @@ and pulse_prevent_non_disj_top = !pulse_prevent_non_disj_top

and pulse_recency_limit = !pulse_recency_limit

and pulse_report_ignore_unknown_java_methods_patterns =
match RevList.to_list !pulse_report_ignore_unknown_java_methods_patterns with
| [] ->
None
| patts ->
Some (Str.regexp (String.concat ~sep:"\\|" patts))


and pulse_report_flows_from_taint_source = !pulse_report_flows_from_taint_source

and pulse_report_flows_to_taint_sink = !pulse_report_flows_to_taint_sink
Expand Down
2 changes: 0 additions & 2 deletions infer/src/base/Config.mli
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,6 @@ val pulse_models_for_erlang : string list

val pulse_prevent_non_disj_top : bool

val pulse_report_ignore_unknown_java_methods_patterns : Str.regexp option

val pulse_report_flows_from_taint_source : string option

val pulse_report_flows_to_taint_sink : string option
Expand Down
10 changes: 0 additions & 10 deletions infer/src/pulse/PulseAbductiveDomain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1765,16 +1765,6 @@ module Summary = struct
)
let skipped_calls_match_pattern astate =
(* For every skipped function, there needs to be at least one regexp given in --pulse_report_ignore_java_methods_patterns
that matches it *)
Option.value_map Config.pulse_report_ignore_unknown_java_methods_patterns ~default:true
~f:(fun patt ->
SkippedCalls.for_all
(fun skipped_proc _ -> Str.string_match patt (Procname.to_string skipped_proc) 0)
astate.skipped_calls )
let with_need_closure_specialization summary = {summary with need_closure_specialization= true}
let add_need_dynamic_type_specialization = add_need_dynamic_type_specialization
Expand Down
2 changes: 0 additions & 2 deletions infer/src/pulse/PulseAbductiveDomain.mli
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@ module Summary : sig
not called twice *)
type summary = private t [@@deriving compare, equal, yojson_of]

val skipped_calls_match_pattern : summary -> bool

val with_need_closure_specialization : summary -> summary

val add_need_dynamic_type_specialization : AbstractValue.t -> summary -> summary
Expand Down
20 changes: 3 additions & 17 deletions infer/src/pulse/PulseReport.ml
Original file line number Diff line number Diff line change
Expand Up @@ -167,28 +167,15 @@ let should_skip_reporting_nullptr_dereference_in_nullsafe_class tenv ~is_nullptr
&& is_nullptr_dereference_in_nullsafe_class tenv ~is_nullptr_dereference jn


let is_suppressed tenv proc_desc ~is_nullptr_dereference ~is_constant_deref_without_invalidation
summary =
let is_suppressed tenv proc_desc ~is_nullptr_dereference ~is_constant_deref_without_invalidation =
if is_constant_deref_without_invalidation then (
L.d_printfln ~color:Red
"Dropping error: constant dereference with no invalidation in the access trace" ;
true )
else
match Procdesc.get_proc_name proc_desc with
| Procname.Java jn when is_nullptr_dereference ->
let b =
should_skip_reporting_nullptr_dereference_in_nullsafe_class tenv ~is_nullptr_dereference
jn
in
if b then (
L.d_printfln ~color:Red "Dropping error: conflicting with nullsafe" ;
b )
else
let b = not (AbductiveDomain.Summary.skipped_calls_match_pattern summary) in
if b then
L.d_printfln ~color:Red
"Dropping error: skipped an unknown function not in the allow list" ;
b
should_skip_reporting_nullptr_dereference_in_nullsafe_class tenv ~is_nullptr_dereference jn
| _ ->
false

Expand Down Expand Up @@ -240,7 +227,7 @@ let report_summary_error tenv proc_desc err_log ((access_error : AccessResult.er
in
let is_suppressed =
is_suppressed tenv proc_desc ~is_nullptr_dereference:true
~is_constant_deref_without_invalidation summary
~is_constant_deref_without_invalidation
in
if is_suppressed then L.d_printfln "suppressed error" ;
if Config.pulse_report_latent_issues then
Expand All @@ -263,7 +250,6 @@ let report_summary_error tenv proc_desc err_log ((access_error : AccessResult.er
in
let is_suppressed =
is_suppressed tenv proc_desc ~is_nullptr_dereference ~is_constant_deref_without_invalidation
summary
in
match LatentIssue.should_report summary diagnostic with
| `ReportNow ->
Expand Down
4 changes: 2 additions & 2 deletions infer/tests/codetoanalyze/java/pulse/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

TESTS_DIR = ../../..
INFER_OPTIONS = --pulse-only --debug-exceptions --pulse-nullsafe-report-npe-as-separate-issue \
--pulse-report-ignore-unknown-java-methods-patterns-reset --pulse-report-issues-for-tests \
--report-suppress-errors SENSITIVE_DATA_FLOW --report-suppress-errors DATA_FLOW_TO_SINK
--pulse-report-issues-for-tests --report-suppress-errors SENSITIVE_DATA_FLOW \
--report-suppress-errors DATA_FLOW_TO_SINK
INFERPRINT_OPTIONS = --issues-tests
SOURCES = $(wildcard *.java taint/*.java)

Expand Down

0 comments on commit 751cec8

Please sign in to comment.