diff --git a/infer/man/man1/infer-analyze.txt b/infer/man/man1/infer-analyze.txt index d697e4e7ee9..83d05a45193 100644 --- a/infer/man/man1/infer-analyze.txt +++ b/infer/man/man1/infer-analyze.txt @@ -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. diff --git a/infer/man/man1/infer-full.txt b/infer/man/man1/infer-full.txt index 8823bf7277a..00d9f3f3874 100644 --- a/infer/man/man1/infer-full.txt +++ b/infer/man/man1/infer-full.txt @@ -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). @@ -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) diff --git a/infer/man/man1/infer.txt b/infer/man/man1/infer.txt index e2d32c7334a..94e71c94052 100644 --- a/infer/man/man1/infer.txt +++ b/infer/man/man1/infer.txt @@ -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). diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 0895f5f8a8a..fc55167a70f 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -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)] @@ -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 diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 1fb40bab737..663bd36b486 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -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 diff --git a/infer/src/pulse/PulseAbductiveDomain.ml b/infer/src/pulse/PulseAbductiveDomain.ml index 3162ba48337..f26482a30ed 100644 --- a/infer/src/pulse/PulseAbductiveDomain.ml +++ b/infer/src/pulse/PulseAbductiveDomain.ml @@ -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 diff --git a/infer/src/pulse/PulseAbductiveDomain.mli b/infer/src/pulse/PulseAbductiveDomain.mli index 8382fd4e30b..16e8e6469a8 100644 --- a/infer/src/pulse/PulseAbductiveDomain.mli +++ b/infer/src/pulse/PulseAbductiveDomain.mli @@ -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 diff --git a/infer/src/pulse/PulseReport.ml b/infer/src/pulse/PulseReport.ml index 60f7b3599d2..596d82b9845 100644 --- a/infer/src/pulse/PulseReport.ml +++ b/infer/src/pulse/PulseReport.ml @@ -167,8 +167,7 @@ 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" ; @@ -176,19 +175,7 @@ let is_suppressed tenv proc_desc ~is_nullptr_dereference ~is_constant_deref_with 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 @@ -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 @@ -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 -> diff --git a/infer/tests/codetoanalyze/java/pulse/Makefile b/infer/tests/codetoanalyze/java/pulse/Makefile index 13e823f122d..5070d445aa4 100644 --- a/infer/tests/codetoanalyze/java/pulse/Makefile +++ b/infer/tests/codetoanalyze/java/pulse/Makefile @@ -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)