get rid of most dynamic severity changes

Summary:
By and large issues of a given type (eg NULL_DEREFERENCE) are always
reported with the same severity (eg ERROR), but that severity is hard to
tease out from the code. This makes it more explicit by favouring the
default in `IssueType.t` in many cases without changing infer's
behaviour. The checkers typically use `Reporting.log_{error,warning}`;
these are taken care of in the next diff.

Reviewed By: skcho

Differential Revision: D21904590

fbshipit-source-id: 47c76cd4c
master
Jules Villard 5 years ago committed by Facebook GitHub Bot
parent c9fc41f97c
commit 682f932150

@ -198,8 +198,8 @@ let update errlog_old errlog_new =
ErrLogHash.iter (fun err_key l -> ignore (add_issue errlog_old err_key l)) errlog_new ErrLogHash.iter (fun err_key l -> ignore (add_issue errlog_old err_key l)) errlog_new
let log_issue severity err_log ~loc ~node ~session ~ltr ~linters_def_file ~doc_url ~access ~extras let log_issue ?severity_override err_log ~loc ~node ~session ~ltr ~linters_def_file ~doc_url ~access
checker exn = ~extras checker exn =
let error = Exceptions.recognize_exception exn in let error = Exceptions.recognize_exception exn in
if not (IssueType.checker_can_report checker error.issue_type) then if not (IssueType.checker_can_report checker error.issue_type) then
L.die InternalError L.die InternalError
@ -209,7 +209,7 @@ let log_issue severity err_log ~loc ~node ~session ~ltr ~linters_def_file ~doc_u
error.issue_type.unique_id (Checker.get_name checker) error.issue_type.unique_id (Checker.get_name checker)
(Checker.get_name error.issue_type.checker) (Checker.get_name error.issue_type.checker)
(Checker.get_name checker) ; (Checker.get_name checker) ;
let severity = Option.value error.severity ~default:severity in let severity = Option.value severity_override ~default:error.issue_type.default_severity in
let hide_java_loc_zero = let hide_java_loc_zero =
(* hide java errors at location zero unless in -developer_mode *) (* hide java errors at location zero unless in -developer_mode *)
(not Config.developer_mode) && Language.curr_language_is Java && Int.equal loc.Location.line 0 (not Config.developer_mode) && Language.curr_language_is Java && Int.equal loc.Location.line 0
@ -254,9 +254,9 @@ let log_issue severity err_log ~loc ~node ~session ~ltr ~linters_def_file ~doc_u
in in
let should_print_now = match exn with Exceptions.Internal_error _ -> true | _ -> added in let should_print_now = match exn with Exceptions.Internal_error _ -> true | _ -> added in
let print_now () = let print_now () =
L.(debug Analysis Medium) L.debug Analysis Medium "@\n%a@\n@?"
"@\n%a@\n@?" (Exceptions.pp_err ~severity_override:severity loc error.issue_type error.description
(Exceptions.pp_err loc severity error.issue_type error.description error.ocaml_pos) error.ocaml_pos)
() ; () ;
if not (IssueType.equal_severity severity Error) then ( if not (IssueType.equal_severity severity Error) then (
let warn_str = let warn_str =

@ -88,7 +88,7 @@ val update : t -> t -> unit
(** Update an old error log with a new one *) (** Update an old error log with a new one *)
val log_issue : val log_issue :
IssueType.severity ?severity_override:IssueType.severity
-> t -> t
-> loc:Location.t -> loc:Location.t
-> node:node -> node:node

@ -100,155 +100,93 @@ exception Wrong_argument_number of L.ocaml_pos
type t = type t =
{ issue_type: IssueType.t { issue_type: IssueType.t
; description: Localise.error_desc ; description: Localise.error_desc
; ocaml_pos: L.ocaml_pos option (** location in the infer source code *) ; ocaml_pos: L.ocaml_pos option (** location in the infer source code *) }
; severity: IssueType.severity option }
let recognize_exception exn = let recognize_exception exn =
match exn with match exn with
| Abduction_case_not_implemented ocaml_pos -> | Abduction_case_not_implemented ocaml_pos ->
{ issue_type= IssueType.abduction_case_not_implemented { issue_type= IssueType.abduction_case_not_implemented
; description= Localise.no_desc ; description= Localise.no_desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= None }
| Analysis_stops (desc, ocaml_pos_opt) -> | Analysis_stops (desc, ocaml_pos_opt) ->
{ issue_type= IssueType.biabduction_analysis_stops {issue_type= IssueType.biabduction_analysis_stops; description= desc; ocaml_pos= ocaml_pos_opt}
; description= desc
; ocaml_pos= ocaml_pos_opt
; severity= None }
| Array_of_pointsto ocaml_pos -> | Array_of_pointsto ocaml_pos ->
{ issue_type= IssueType.array_of_pointsto { issue_type= IssueType.array_of_pointsto
; description= Localise.no_desc ; description= Localise.no_desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= None }
| Array_out_of_bounds_l1 (desc, ocaml_pos) -> | Array_out_of_bounds_l1 (desc, ocaml_pos) ->
{ issue_type= IssueType.array_out_of_bounds_l1 {issue_type= IssueType.array_out_of_bounds_l1; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= Some Error }
| Array_out_of_bounds_l2 (desc, ocaml_pos) -> | Array_out_of_bounds_l2 (desc, ocaml_pos) ->
{ issue_type= IssueType.array_out_of_bounds_l2 {issue_type= IssueType.array_out_of_bounds_l2; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Array_out_of_bounds_l3 (desc, ocaml_pos) -> | Array_out_of_bounds_l3 (desc, ocaml_pos) ->
{ issue_type= IssueType.array_out_of_bounds_l3 {issue_type= IssueType.array_out_of_bounds_l3; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Assert_failure (f, l, c) -> | Assert_failure (f, l, c) ->
let ocaml_pos = (f, l, c, c) in let ocaml_pos = (f, l, c, c) in
{ issue_type= IssueType.assert_failure { issue_type= IssueType.assert_failure
; description= Localise.no_desc ; description= Localise.no_desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= None }
| Bad_footprint ocaml_pos -> | Bad_footprint ocaml_pos ->
{ issue_type= IssueType.bad_footprint {issue_type= IssueType.bad_footprint; description= Localise.no_desc; ocaml_pos= Some ocaml_pos}
; description= Localise.no_desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Biabd_use_after_free (desc, ocaml_pos) -> | Biabd_use_after_free (desc, ocaml_pos) ->
{ issue_type= IssueType.biabd_use_after_free {issue_type= IssueType.biabd_use_after_free; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Cannot_star ocaml_pos -> | Cannot_star ocaml_pos ->
{ issue_type= IssueType.cannot_star {issue_type= IssueType.cannot_star; description= Localise.no_desc; ocaml_pos= Some ocaml_pos}
; description= Localise.no_desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Class_cast_exception (desc, ocaml_pos) -> | Class_cast_exception (desc, ocaml_pos) ->
{ issue_type= IssueType.class_cast_exception {issue_type= IssueType.class_cast_exception; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Condition_always_true_false (desc, b, ocaml_pos) -> | Condition_always_true_false (desc, b, ocaml_pos) ->
let issue_type = let issue_type =
if b then IssueType.biabd_condition_always_true else IssueType.biabd_condition_always_false if b then IssueType.biabd_condition_always_true else IssueType.biabd_condition_always_false
in in
{issue_type; description= desc; ocaml_pos= Some ocaml_pos; severity= None} {issue_type; description= desc; ocaml_pos= Some ocaml_pos}
| Custom_error (error_msg, severity, desc) -> | Custom_error (error_msg, severity, desc) ->
{ issue_type= IssueType.register_from_string ~id:error_msg severity Biabduction { issue_type= IssueType.register_from_string ~id:error_msg severity Biabduction
; description= desc ; description= desc
; ocaml_pos= None ; ocaml_pos= None }
; severity= None }
| Dangling_pointer_dereference (user_visible, desc, ocaml_pos) -> | Dangling_pointer_dereference (user_visible, desc, ocaml_pos) ->
let issue_type = let issue_type =
if user_visible then IssueType.dangling_pointer_dereference if user_visible then IssueType.dangling_pointer_dereference
else IssueType.dangling_pointer_dereference_maybe else IssueType.dangling_pointer_dereference_maybe
in in
{issue_type; description= desc; ocaml_pos= Some ocaml_pos; severity= None} {issue_type; description= desc; ocaml_pos= Some ocaml_pos}
| Deallocate_stack_variable desc -> | Deallocate_stack_variable desc ->
{ issue_type= IssueType.deallocate_stack_variable {issue_type= IssueType.deallocate_stack_variable; description= desc; ocaml_pos= None}
; description= desc
; ocaml_pos= None
; severity= None }
| Deallocate_static_memory desc -> | Deallocate_static_memory desc ->
{ issue_type= IssueType.deallocate_static_memory {issue_type= IssueType.deallocate_static_memory; description= desc; ocaml_pos= None}
; description= desc
; ocaml_pos= None
; severity= None }
| Deallocation_mismatch (desc, ocaml_pos) -> | Deallocation_mismatch (desc, ocaml_pos) ->
{ issue_type= IssueType.deallocation_mismatch {issue_type= IssueType.deallocation_mismatch; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Divide_by_zero (desc, ocaml_pos) -> | Divide_by_zero (desc, ocaml_pos) ->
{ issue_type= IssueType.divide_by_zero {issue_type= IssueType.divide_by_zero; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= Some Error }
| Empty_vector_access (desc, ocaml_pos) -> | Empty_vector_access (desc, ocaml_pos) ->
{ issue_type= IssueType.empty_vector_access {issue_type= IssueType.empty_vector_access; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= Some Error }
| Field_not_null_checked (desc, ocaml_pos) -> | Field_not_null_checked (desc, ocaml_pos) ->
{ issue_type= IssueType.field_not_null_checked {issue_type= IssueType.field_not_null_checked; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= Some Warning }
| Frontend_warning (issue_type, desc, ocaml_pos) -> | Frontend_warning (issue_type, desc, ocaml_pos) ->
{issue_type; description= desc; ocaml_pos= Some ocaml_pos; severity= None} {issue_type; description= desc; ocaml_pos= Some ocaml_pos}
| Checkers (kind, desc) -> | Checkers (kind, desc) ->
{issue_type= kind; description= desc; ocaml_pos= None; severity= None} {issue_type= kind; description= desc; ocaml_pos= None}
| Null_dereference (desc, ocaml_pos) -> | Null_dereference (desc, ocaml_pos) ->
{ issue_type= IssueType.null_dereference {issue_type= IssueType.null_dereference; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Null_test_after_dereference (desc, ocaml_pos) -> | Null_test_after_dereference (desc, ocaml_pos) ->
{ issue_type= IssueType.null_test_after_dereference { issue_type= IssueType.null_test_after_dereference
; description= desc ; description= desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= None }
| Pointer_size_mismatch (desc, ocaml_pos) -> | Pointer_size_mismatch (desc, ocaml_pos) ->
{ issue_type= IssueType.pointer_size_mismatch {issue_type= IssueType.pointer_size_mismatch; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= Some Error }
| Inherently_dangerous_function desc -> | Inherently_dangerous_function desc ->
{ issue_type= IssueType.inherently_dangerous_function {issue_type= IssueType.inherently_dangerous_function; description= desc; ocaml_pos= None}
; description= desc
; ocaml_pos= None
; severity= None }
| Internal_error desc -> | Internal_error desc ->
{issue_type= IssueType.internal_error; description= desc; ocaml_pos= None; severity= None} {issue_type= IssueType.internal_error; description= desc; ocaml_pos= None}
| Leak (fp_part, (user_visible, error_desc), done_array_abstraction, resource, ocaml_pos) -> | Leak (fp_part, (user_visible, error_desc), done_array_abstraction, resource, ocaml_pos) ->
if done_array_abstraction then if done_array_abstraction then
{ issue_type= IssueType.leak_after_array_abstraction { issue_type= IssueType.leak_after_array_abstraction
; description= error_desc ; description= error_desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= None }
else if fp_part then else if fp_part then
{ issue_type= IssueType.leak_in_footprint {issue_type= IssueType.leak_in_footprint; description= error_desc; ocaml_pos= Some ocaml_pos}
; description= error_desc
; ocaml_pos= Some ocaml_pos
; severity= None }
else if not user_visible then else if not user_visible then
{ issue_type= IssueType.leak_unknown_origin { issue_type= IssueType.leak_unknown_origin
; description= error_desc ; description= error_desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= None }
else else
let issue_type = let issue_type =
match resource with match resource with
@ -261,83 +199,53 @@ let recognize_exception exn =
| PredSymb.Rignore -> | PredSymb.Rignore ->
IssueType.memory_leak IssueType.memory_leak
in in
{issue_type; description= error_desc; ocaml_pos= Some ocaml_pos; severity= None} {issue_type; description= error_desc; ocaml_pos= Some ocaml_pos}
| Missing_fld (fld, ocaml_pos) -> | Missing_fld (fld, ocaml_pos) ->
let desc = Localise.verbatim_desc (Fieldname.to_full_string fld) in let desc = Localise.verbatim_desc (Fieldname.to_full_string fld) in
{ issue_type= IssueType.missing_fld {issue_type= IssueType.missing_fld; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Premature_nil_termination (desc, ocaml_pos) -> | Premature_nil_termination (desc, ocaml_pos) ->
{ issue_type= IssueType.premature_nil_termination {issue_type= IssueType.premature_nil_termination; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Parameter_not_null_checked (desc, ocaml_pos) -> | Parameter_not_null_checked (desc, ocaml_pos) ->
{ issue_type= IssueType.parameter_not_null_checked { issue_type= IssueType.parameter_not_null_checked
; description= desc ; description= desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= Some Warning }
| Precondition_not_found (desc, ocaml_pos) -> | Precondition_not_found (desc, ocaml_pos) ->
{ issue_type= IssueType.precondition_not_found {issue_type= IssueType.precondition_not_found; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Precondition_not_met (desc, ocaml_pos) -> | Precondition_not_met (desc, ocaml_pos) ->
{ issue_type= IssueType.precondition_not_met {issue_type= IssueType.precondition_not_met; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= Some Warning }
(* always a warning *)
| Retain_cycle (desc, ocaml_pos) -> | Retain_cycle (desc, ocaml_pos) ->
{ issue_type= IssueType.retain_cycle {issue_type= IssueType.retain_cycle; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= None }
| Registered_observer_being_deallocated (desc, ocaml_pos) -> | Registered_observer_being_deallocated (desc, ocaml_pos) ->
{ issue_type= IssueType.biabd_registered_observer_being_deallocated { issue_type= IssueType.biabd_registered_observer_being_deallocated
; description= desc ; description= desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= Some Error }
| Stack_variable_address_escape (desc, ocaml_pos) -> | Stack_variable_address_escape (desc, ocaml_pos) ->
{ issue_type= IssueType.biabd_stack_variable_address_escape { issue_type= IssueType.biabd_stack_variable_address_escape
; description= desc ; description= desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= Some Error }
| SymOp.Analysis_failure_exe _ -> | SymOp.Analysis_failure_exe _ ->
{ issue_type= IssueType.failure_exe {issue_type= IssueType.failure_exe; description= Localise.no_desc; ocaml_pos= None}
; description= Localise.no_desc
; ocaml_pos= None
; severity= None }
| Skip_function desc -> | Skip_function desc ->
{issue_type= IssueType.skip_function; description= desc; ocaml_pos= None; severity= None} {issue_type= IssueType.skip_function; description= desc; ocaml_pos= None}
| Skip_pointer_dereference (desc, ocaml_pos) -> | Skip_pointer_dereference (desc, ocaml_pos) ->
{ issue_type= IssueType.skip_pointer_dereference {issue_type= IssueType.skip_pointer_dereference; description= desc; ocaml_pos= Some ocaml_pos}
; description= desc
; ocaml_pos= Some ocaml_pos
; severity= Some Info }
(* always an info *)
| Symexec_memory_error ocaml_pos -> | Symexec_memory_error ocaml_pos ->
{ issue_type= IssueType.symexec_memory_error { issue_type= IssueType.symexec_memory_error
; description= Localise.no_desc ; description= Localise.no_desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= None }
| Unary_minus_applied_to_unsigned_expression (desc, ocaml_pos) -> | Unary_minus_applied_to_unsigned_expression (desc, ocaml_pos) ->
{ issue_type= IssueType.unary_minus_applied_to_unsigned_expression { issue_type= IssueType.unary_minus_applied_to_unsigned_expression
; description= desc ; description= desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= None }
| Wrong_argument_number ocaml_pos -> | Wrong_argument_number ocaml_pos ->
{ issue_type= IssueType.wrong_argument_number { issue_type= IssueType.wrong_argument_number
; description= Localise.no_desc ; description= Localise.no_desc
; ocaml_pos= Some ocaml_pos ; ocaml_pos= Some ocaml_pos }
; severity= None }
| exn -> | exn ->
{ issue_type= IssueType.failure_exe { issue_type= IssueType.failure_exe
; description= ; description=
Localise.verbatim_desc (F.asprintf "%a: %s" Exn.pp exn (Caml.Printexc.get_backtrace ())) Localise.verbatim_desc (F.asprintf "%a: %s" Exn.pp exn (Caml.Printexc.get_backtrace ()))
; ocaml_pos= None ; ocaml_pos= None }
; severity= None }
(** print a description of the exception to the html output *) (** print a description of the exception to the html output *)
@ -355,7 +263,8 @@ let print_exception_html s exn =
(** pretty print an error *) (** pretty print an error *)
let pp_err loc severity issue_type desc ocaml_pos_opt fmt () = let pp_err ?severity_override loc issue_type desc ocaml_pos_opt fmt () =
let severity = Option.value severity_override ~default:issue_type.IssueType.default_severity in
let kind = let kind =
IssueType.string_of_severity IssueType.string_of_severity
(if IssueType.equal_severity severity Info then Warning else severity) (if IssueType.equal_severity severity Info then Warning else severity)

@ -105,8 +105,8 @@ val print_exception_html : string -> exn -> unit
(** print a description of the exception to the html output *) (** print a description of the exception to the html output *)
val pp_err : val pp_err :
Location.t ?severity_override:IssueType.severity
-> IssueType.severity -> Location.t
-> IssueType.t -> IssueType.t
-> Localise.error_desc -> Localise.error_desc
-> Logging.ocaml_pos option -> Logging.ocaml_pos option
@ -118,7 +118,6 @@ val pp_err :
type t = type t =
{ issue_type: IssueType.t { issue_type: IssueType.t
; description: Localise.error_desc ; description: Localise.error_desc
; ocaml_pos: Logging.ocaml_pos option (** location in the infer source code *) ; ocaml_pos: Logging.ocaml_pos option (** location in the infer source code *) }
; severity: IssueType.severity option }
val recognize_exception : exn -> t val recognize_exception : exn -> t

@ -10,22 +10,23 @@ open! IStd
type log_t = type log_t =
?ltr:Errlog.loc_trace -> ?extras:Jsonbug_t.extra -> Checker.t -> IssueType.t -> string -> unit ?ltr:Errlog.loc_trace -> ?extras:Jsonbug_t.extra -> Checker.t -> IssueType.t -> string -> unit
let log_issue_from_errlog severity err_log ~loc ~node ~session ~ltr ~access ~extras checker exn = let log_issue_from_errlog ?severity_override err_log ~loc ~node ~session ~ltr ~access ~extras
checker exn =
let issue_type = (Exceptions.recognize_exception exn).issue_type in let issue_type = (Exceptions.recognize_exception exn).issue_type in
if (not Config.filtering) (* no-filtering takes priority *) || issue_type.IssueType.enabled then if (not Config.filtering) (* no-filtering takes priority *) || issue_type.IssueType.enabled then
let doc_url = issue_type.doc_url in let doc_url = issue_type.doc_url in
let linters_def_file = issue_type.linters_def_file in let linters_def_file = issue_type.linters_def_file in
Errlog.log_issue severity err_log ~loc ~node ~session ~ltr ~linters_def_file ~doc_url ~access Errlog.log_issue ?severity_override err_log ~loc ~node ~session ~ltr ~linters_def_file ~doc_url
~extras checker exn ~access ~extras checker exn
let log_frontend_issue severity errlog ~loc ~node_key ~ltr exn = let log_frontend_issue errlog ~loc ~node_key ~ltr exn =
let node = Errlog.FrontendNode {node_key} in let node = Errlog.FrontendNode {node_key} in
log_issue_from_errlog severity errlog ~loc ~node ~session:0 ~ltr ~access:None ~extras:None Linters log_issue_from_errlog errlog ~loc ~node ~session:0 ~ltr ~access:None ~extras:None Linters exn
exn
let log_issue_from_summary severity proc_desc err_log ~node ~session ~loc ~ltr ?extras checker exn = let log_issue_from_summary ?severity_override proc_desc err_log ~node ~session ~loc ~ltr ?extras
checker exn =
let procname = Procdesc.get_proc_name proc_desc in let procname = Procdesc.get_proc_name proc_desc in
let is_java_generated_method = let is_java_generated_method =
match procname with match procname with
@ -49,36 +50,38 @@ let log_issue_from_summary severity proc_desc err_log ~node ~session ~loc ~ltr ?
if should_suppress_lint || is_java_generated_method || is_java_external_package then if should_suppress_lint || is_java_generated_method || is_java_external_package then
Logging.debug Analysis Medium "Reporting is suppressed!@\n" (* Skip the reporting *) Logging.debug Analysis Medium "Reporting is suppressed!@\n" (* Skip the reporting *)
else else
log_issue_from_errlog severity err_log ~loc ~node ~session ~ltr ~access:None ~extras checker exn log_issue_from_errlog ?severity_override err_log ~loc ~node ~session ~ltr ~access:None ~extras
checker exn
let checker_exception issue_type error_message = let checker_exception issue_type error_message =
Exceptions.Checkers (issue_type, Localise.verbatim_desc error_message) Exceptions.Checkers (issue_type, Localise.verbatim_desc error_message)
let log_issue_from_summary_simplified severity attrs err_log ~loc ?(ltr = []) ?extras checker let log_issue_from_summary_simplified ?severity_override attrs err_log ~loc ?(ltr = []) ?extras
issue_type error_message = checker issue_type error_message =
let exn = checker_exception issue_type error_message in let exn = checker_exception issue_type error_message in
log_issue_from_summary severity attrs err_log ~node:Errlog.UnknownNode ~session:0 ~loc ~ltr log_issue_from_summary ?severity_override attrs err_log ~node:Errlog.UnknownNode ~session:0 ~loc
?extras checker exn ~ltr ?extras checker exn
let log_error attrs err_log ~loc ?ltr ?extras checker issue_type error_message = let log_error attrs err_log ~loc ?ltr ?extras checker issue_type error_message =
log_issue_from_summary_simplified Error attrs err_log ~loc ?ltr ?extras checker issue_type log_issue_from_summary_simplified ~severity_override:Error attrs err_log ~loc ?ltr ?extras checker
error_message issue_type error_message
let log_warning attrs err_log ~loc ?ltr ?extras checker issue_type error_message = let log_warning attrs err_log ~loc ?ltr ?extras checker issue_type error_message =
log_issue_from_summary_simplified Warning attrs err_log ~loc ?ltr ?extras checker issue_type log_issue_from_summary_simplified ~severity_override:Warning attrs err_log ~loc ?ltr ?extras
error_message checker issue_type error_message
let log_issue_external procname ~issue_log severity ~loc ~ltr ?access ?extras checker issue_type let log_issue_external procname ~issue_log ?severity_override ~loc ~ltr ?access ?extras checker
error_message = issue_type error_message =
let exn = checker_exception issue_type error_message in let exn = checker_exception issue_type error_message in
let issue_log, errlog = IssueLog.get_or_add issue_log ~proc:procname in let issue_log, errlog = IssueLog.get_or_add issue_log ~proc:procname in
let node = Errlog.UnknownNode in let node = Errlog.UnknownNode in
log_issue_from_errlog severity errlog ~loc ~node ~session:0 ~ltr ~access ~extras checker exn ; log_issue_from_errlog ?severity_override errlog ~loc ~node ~session:0 ~ltr ~access ~extras checker
exn ;
issue_log issue_log

@ -13,7 +13,7 @@ type log_t =
?ltr:Errlog.loc_trace -> ?extras:Jsonbug_t.extra -> Checker.t -> IssueType.t -> string -> unit ?ltr:Errlog.loc_trace -> ?extras:Jsonbug_t.extra -> Checker.t -> IssueType.t -> string -> unit
val log_issue_from_summary : val log_issue_from_summary :
IssueType.severity ?severity_override:IssueType.severity
-> Procdesc.t -> Procdesc.t
-> Errlog.t -> Errlog.t
-> node:Errlog.node -> node:Errlog.node
@ -26,13 +26,7 @@ val log_issue_from_summary :
-> unit -> unit
val log_frontend_issue : val log_frontend_issue :
IssueType.severity Errlog.t -> loc:Location.t -> node_key:Procdesc.NodeKey.t -> ltr:Errlog.loc_trace -> exn -> unit
-> Errlog.t
-> loc:Location.t
-> node_key:Procdesc.NodeKey.t
-> ltr:Errlog.loc_trace
-> exn
-> unit
(** Report a frontend issue of a given kind in the given error log. *) (** Report a frontend issue of a given kind in the given error log. *)
val log_error : Procdesc.t -> Errlog.t -> loc:Location.t -> log_t val log_error : Procdesc.t -> Errlog.t -> loc:Location.t -> log_t
@ -44,7 +38,7 @@ val log_warning : Procdesc.t -> Errlog.t -> loc:Location.t -> log_t
val log_issue_external : val log_issue_external :
Procname.t Procname.t
-> issue_log:IssueLog.t -> issue_log:IssueLog.t
-> IssueType.severity -> ?severity_override:IssueType.severity
-> loc:Location.t -> loc:Location.t
-> ltr:Errlog.loc_trace -> ltr:Errlog.loc_trace
-> ?access:string -> ?access:string

@ -503,8 +503,7 @@ let log_frontend_issue method_decl_opt (node : Ctl_parser_types.ast_node) (issue
CAst_utils.generate_key_stmt st CAst_utils.generate_key_stmt st
in in
let node_key = Procdesc.NodeKey.of_frontend_node_key key_str in let node_key = Procdesc.NodeKey.of_frontend_node_key key_str in
Reporting.log_frontend_issue issue_desc.severity errlog exn ~loc:issue_desc.loc ~ltr:trace Reporting.log_frontend_issue errlog exn ~loc:issue_desc.loc ~ltr:trace ~node_key
~node_key
let fill_issue_desc_info_and_log context ~witness ~current_node (issue_desc : CIssue.t) loc = let fill_issue_desc_info_and_log context ~witness ~current_node (issue_desc : CIssue.t) loc =

@ -191,7 +191,7 @@ let run_proc_analysis ~caller_pdesc callee_pdesc =
summary summary
in in
let log_error_and_continue exn (summary : Summary.t) kind = let log_error_and_continue exn (summary : Summary.t) kind =
BiabductionReporting.log_error_using_state (Summary.get_proc_desc summary) BiabductionReporting.log_issue_using_state (Summary.get_proc_desc summary)
(Summary.get_err_log summary) exn ; (Summary.get_err_log summary) exn ;
let stats = Summary.Stats.update summary.stats ~failure_kind:kind in let stats = Summary.Stats.update summary.stats ~failure_kind:kind in
let payloads = let payloads =

@ -24,6 +24,7 @@ type t = private
; checker: Checker.t ; checker: Checker.t
; visibility: visibility ; visibility: visibility
; mutable default_severity: severity ; mutable default_severity: severity
(** used for documentation but can be overriden at report time *)
; mutable enabled: bool ; mutable enabled: bool
; mutable hum: string ; mutable hum: string
; mutable doc_url: string option ; mutable doc_url: string option

@ -1142,7 +1142,7 @@ let check_junk {InterproceduralAnalysis.proc_desc; err_log; tenv} prop =
let report_leak () = let report_leak () =
if not report_and_continue then raise exn if not report_and_continue then raise exn
else ( else (
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Error exn ; BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn ;
leaks_reported := alloc_attribute :: !leaks_reported ) leaks_reported := alloc_attribute :: !leaks_reported )
in in
if not ignore_leak then report_leak () ; if not ignore_leak then report_leak () ;

@ -7,7 +7,7 @@
open! IStd open! IStd
let log_issue_deprecated_using_state proc_desc err_log severity ?node ?loc ?ltr exn = let log_issue_deprecated_using_state proc_desc err_log ?node ?loc ?ltr exn =
if !BiabductionConfig.footprint then if !BiabductionConfig.footprint then
let node = let node =
let node = match node with None -> AnalysisState.get_node_exn () | Some node -> node in let node = match node with None -> AnalysisState.get_node_exn () | Some node -> node in
@ -16,11 +16,10 @@ let log_issue_deprecated_using_state proc_desc err_log severity ?node ?loc ?ltr
let session = AnalysisState.get_session () in let session = AnalysisState.get_session () in
let loc = match loc with None -> AnalysisState.get_loc_exn () | Some loc -> loc in let loc = match loc with None -> AnalysisState.get_loc_exn () | Some loc -> loc in
let ltr = match ltr with None -> State.get_loc_trace () | Some ltr -> ltr in let ltr = match ltr with None -> State.get_loc_trace () | Some ltr -> ltr in
Reporting.log_issue_from_summary severity proc_desc err_log ~node ~session ~loc ~ltr Biabduction Reporting.log_issue_from_summary proc_desc err_log ~node ~session ~loc ~ltr Biabduction exn
exn
let log_error_using_state proc_desc err_log exn = let log_issue_using_state proc_desc err_log exn =
if !BiabductionConfig.footprint then if !BiabductionConfig.footprint then
let node' = let node' =
match AnalysisState.get_node () with Some n -> n | None -> Procdesc.get_start_node proc_desc match AnalysisState.get_node () with Some n -> n | None -> Procdesc.get_start_node proc_desc
@ -31,5 +30,4 @@ let log_error_using_state proc_desc err_log exn =
match AnalysisState.get_loc () with Some l -> l | None -> Procdesc.Node.get_loc node' match AnalysisState.get_loc () with Some l -> l | None -> Procdesc.Node.get_loc node'
in in
let ltr = State.get_loc_trace () in let ltr = State.get_loc_trace () in
Reporting.log_issue_from_summary Error proc_desc err_log ~node ~session ~loc ~ltr Biabduction Reporting.log_issue_from_summary proc_desc err_log ~node ~session ~loc ~ltr Biabduction exn
exn

@ -7,13 +7,12 @@
open! IStd open! IStd
val log_error_using_state : Procdesc.t -> Errlog.t -> exn -> unit val log_issue_using_state : Procdesc.t -> Errlog.t -> exn -> unit
(** Add an error to the given summary using biabduction state. *) (** Add an issue to the given summary using biabduction state. *)
val log_issue_deprecated_using_state : val log_issue_deprecated_using_state :
Procdesc.t Procdesc.t
-> Errlog.t -> Errlog.t
-> IssueType.severity
-> ?node:Procdesc.Node.t -> ?node:Procdesc.Node.t
-> ?loc:Location.t -> ?loc:Location.t
-> ?ltr:Errlog.loc_trace -> ?ltr:Errlog.loc_trace

@ -2507,7 +2507,7 @@ let check_implication_base {InterproceduralAnalysis.proc_desc; err_log; tenv} ch
L.d_printfln "WARNING: footprint failed to find MISSING because: %s" s ; L.d_printfln "WARNING: footprint failed to find MISSING because: %s" s ;
None None
| Exceptions.Abduction_case_not_implemented _ as exn -> | Exceptions.Abduction_case_not_implemented _ as exn ->
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Error exn ; BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn ;
None None

@ -55,7 +55,7 @@ let check_bad_index {InterproceduralAnalysis.proc_desc; err_log; tenv} pname p l
Exceptions.Array_out_of_bounds_l1 Exceptions.Array_out_of_bounds_l1
(Errdesc.explain_array_access pname tenv deref_str p loc, __POS__) (Errdesc.explain_array_access pname tenv deref_str p loc, __POS__)
in in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Warning exn BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn
else if len_is_constant then else if len_is_constant then
let deref_str = Localise.deref_str_array_bound len_const_opt index_const_opt in let deref_str = Localise.deref_str_array_bound len_const_opt index_const_opt in
let desc = Errdesc.explain_array_access pname tenv deref_str p loc in let desc = Errdesc.explain_array_access pname tenv deref_str p loc in
@ -63,7 +63,7 @@ let check_bad_index {InterproceduralAnalysis.proc_desc; err_log; tenv} pname p l
if index_has_bounds () then Exceptions.Array_out_of_bounds_l2 (desc, __POS__) if index_has_bounds () then Exceptions.Array_out_of_bounds_l2 (desc, __POS__)
else Exceptions.Array_out_of_bounds_l3 (desc, __POS__) else Exceptions.Array_out_of_bounds_l3 (desc, __POS__)
in in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Warning exn BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn
(** Perform bounds checking *) (** Perform bounds checking *)
@ -1014,7 +1014,7 @@ let check_type_size {InterproceduralAnalysis.proc_desc; err_log; tenv} pname pro
Exceptions.Pointer_size_mismatch Exceptions.Pointer_size_mismatch
(Errdesc.explain_dereference pname tenv deref_str prop loc, __POS__) (Errdesc.explain_dereference pname tenv deref_str prop loc, __POS__)
in in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Warning exn BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn
| None -> | None ->
L.d_str "texp: " ; L.d_str "texp: " ;
Exp.d_texp_full texp ; Exp.d_texp_full texp ;

@ -245,7 +245,7 @@ let report_cycle {InterproceduralAnalysis.proc_desc; tenv; err_log} prop =
RetainCyclesType.Set.iter RetainCyclesType.Set.iter
(fun cycle -> (fun cycle ->
let exn = exn_retain_cycle tenv cycle in let exn = exn_retain_cycle tenv cycle in
BiabductionReporting.log_error_using_state proc_desc err_log exn ) BiabductionReporting.log_issue_using_state proc_desc err_log exn )
cycles ; cycles ;
(* we report the retain cycles above but need to raise an exception as well to stop the analysis *) (* we report the retain cycles above but need to raise an exception as well to stop the analysis *)
raise (Exceptions.Analysis_stops (Localise.verbatim_desc "retain cycle found", Some __POS__)) ) raise (Exceptions.Analysis_stops (Localise.verbatim_desc "retain cycle found", Some __POS__)) )

@ -345,7 +345,7 @@ let check_inherently_dangerous_function {InterproceduralAnalysis.proc_desc; err_
Exceptions.Inherently_dangerous_function Exceptions.Inherently_dangerous_function
(Localise.desc_inherently_dangerous_function callee_pname) (Localise.desc_inherently_dangerous_function callee_pname)
in in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Warning exn BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn
let reason_to_skip ~callee_desc : string option = let reason_to_skip ~callee_desc : string option =
@ -410,7 +410,7 @@ let check_arith_norm_exp {InterproceduralAnalysis.proc_desc; err_log; tenv} exp
(AnalysisState.get_loc_exn ()) (AnalysisState.get_loc_exn ())
in in
let exn = Exceptions.Divide_by_zero (desc, __POS__) in let exn = Exceptions.Divide_by_zero (desc, __POS__) in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Warning exn ; BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn ;
(Prop.exp_normalize_prop tenv prop exp, prop') (Prop.exp_normalize_prop tenv prop exp, prop')
| Some (Attribute.UminusUnsigned (e, typ)), prop' -> | Some (Attribute.UminusUnsigned (e, typ)), prop' ->
let desc = let desc =
@ -418,7 +418,7 @@ let check_arith_norm_exp {InterproceduralAnalysis.proc_desc; err_log; tenv} exp
(AnalysisState.get_node_exn ()) (AnalysisState.get_loc_exn ()) (AnalysisState.get_node_exn ()) (AnalysisState.get_loc_exn ())
in in
let exn = Exceptions.Unary_minus_applied_to_unsigned_expression (desc, __POS__) in let exn = Exceptions.Unary_minus_applied_to_unsigned_expression (desc, __POS__) in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Warning exn ; BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn ;
(Prop.exp_normalize_prop tenv prop exp, prop') (Prop.exp_normalize_prop tenv prop exp, prop')
| None, prop' -> | None, prop' ->
(Prop.exp_normalize_prop tenv prop exp, prop') (Prop.exp_normalize_prop tenv prop exp, prop')
@ -476,7 +476,7 @@ let check_already_dereferenced {InterproceduralAnalysis.proc_desc; err_log; tenv
(AnalysisState.get_node_exn ()) n (AnalysisState.get_loc_exn ()) (AnalysisState.get_node_exn ()) n (AnalysisState.get_loc_exn ())
in in
let exn = Exceptions.Null_test_after_dereference (desc, __POS__) in let exn = Exceptions.Null_test_after_dereference (desc, __POS__) in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Warning exn BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn
| None -> | None ->
() ()
@ -1206,7 +1206,7 @@ let rec sym_exec
ret_id_typ ret_typ actual_args = ret_id_typ ret_typ actual_args =
let skip_res () = let skip_res () =
let exn = Exceptions.Skip_function (Localise.desc_skip_function callee_pname) in let exn = Exceptions.Skip_function (Localise.desc_skip_function callee_pname) in
BiabductionReporting.log_issue_deprecated_using_state current_pdesc err_log Info exn ; BiabductionReporting.log_issue_deprecated_using_state current_pdesc err_log exn ;
L.d_printfln "Skipping function '%a': %s" Procname.pp callee_pname reason ; L.d_printfln "Skipping function '%a': %s" Procname.pp callee_pname reason ;
unknown_or_scan_call ~is_scan:false ~reason ret_typ ret_annots unknown_or_scan_call ~is_scan:false ~reason ret_typ ret_annots
{ Builtin.instr { Builtin.instr
@ -1257,8 +1257,7 @@ let rec sym_exec
let exn = let exn =
Exceptions.Condition_always_true_false (desc, not (IntLit.iszero i), __POS__) Exceptions.Condition_always_true_false (desc, not (IntLit.iszero i), __POS__)
in in
BiabductionReporting.log_issue_deprecated_using_state current_pdesc err_log Warning BiabductionReporting.log_issue_deprecated_using_state current_pdesc err_log exn
exn
| _ -> | _ ->
() ()
in in

@ -401,7 +401,7 @@ let check_path_errors_in_post {InterproceduralAnalysis.proc_desc= caller_pdesc;
in in
State.set_path new_path path_pos_opt ; State.set_path new_path path_pos_opt ;
let exn = Exceptions.Divide_by_zero (desc, __POS__) in let exn = Exceptions.Divide_by_zero (desc, __POS__) in
BiabductionReporting.log_issue_deprecated_using_state caller_pdesc err_log Warning exn ) BiabductionReporting.log_issue_deprecated_using_state caller_pdesc err_log exn )
| _ -> | _ ->
() ()
in in
@ -1132,7 +1132,7 @@ let exe_spec
missing_sigma_objc_class callee_summary ) ; missing_sigma_objc_class callee_summary ) ;
let log_check_exn check = let log_check_exn check =
let exn = get_check_exn tenv check callee_pname loc __POS__ in let exn = get_check_exn tenv check callee_pname loc __POS__ in
BiabductionReporting.log_issue_deprecated_using_state caller_pdesc err_log Warning exn BiabductionReporting.log_issue_deprecated_using_state caller_pdesc err_log exn
in in
let do_split () = let do_split () =
process_splitting actual_pre sub1 sub2 frame missing_pi missing_sigma frame_fld missing_fld process_splitting actual_pre sub1 sub2 frame missing_pi missing_sigma frame_fld missing_fld

@ -404,7 +404,7 @@ let forward_tabulate ({InterproceduralAnalysis.proc_desc; err_log; tenv; _} as a
L.d_strln "SIL INSTR:" ; L.d_strln "SIL INSTR:" ;
Procdesc.Node.d_instrs ~highlight:(AnalysisState.get_instr ()) curr_node ; Procdesc.Node.d_instrs ~highlight:(AnalysisState.get_instr ()) curr_node ;
L.d_ln () ; L.d_ln () ;
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Error exn ; BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn ;
State.mark_instr_fail exn State.mark_instr_fail exn
in in
let exe_iter f pathset = let exe_iter f pathset =
@ -493,7 +493,7 @@ let remove_locals_formals_and_check {InterproceduralAnalysis.proc_desc; err_log;
let dexp_opt, _ = Errdesc.vpath_find tenv p (Exp.Lvar pvar) in let dexp_opt, _ = Errdesc.vpath_find tenv p (Exp.Lvar pvar) in
let desc = Errdesc.explain_stack_variable_address_escape loc pvar dexp_opt in let desc = Errdesc.explain_stack_variable_address_escape loc pvar dexp_opt in
let exn = Exceptions.Stack_variable_address_escape (desc, __POS__) in let exn = Exceptions.Stack_variable_address_escape (desc, __POS__) in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Warning exn BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn
in in
List.iter ~f:check_pvar pvars ; List.iter ~f:check_pvar pvars ;
p' p'
@ -803,7 +803,7 @@ let perform_analysis_phase ({InterproceduralAnalysis.proc_desc; err_log; tenv} a
in in
let get_results (wl : Worklist.t) () = let get_results (wl : Worklist.t) () =
State.process_execution_failures State.process_execution_failures
(BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Warning) ; (BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log) ;
let results = collect_analysis_result analysis_data wl proc_cfg in let results = collect_analysis_result analysis_data wl proc_cfg in
let specs = let specs =
try extract_specs analysis_data (ProcCfg.Exceptional.proc_desc proc_cfg) results try extract_specs analysis_data (ProcCfg.Exceptional.proc_desc proc_cfg) results
@ -812,7 +812,7 @@ let perform_analysis_phase ({InterproceduralAnalysis.proc_desc; err_log; tenv} a
Exceptions.Internal_error Exceptions.Internal_error
(Localise.verbatim_desc "Leak_while_collecting_specs_after_footprint") (Localise.verbatim_desc "Leak_while_collecting_specs_after_footprint")
in in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Error exn ; BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn ;
(* returning no specs *) [] (* returning no specs *) []
in in
(specs, BiabductionSummary.FOOTPRINT) (specs, BiabductionSummary.FOOTPRINT)
@ -928,7 +928,7 @@ let report_custom_errors {InterproceduralAnalysis.proc_desc; err_log; tenv} summ
let loc = Procdesc.get_loc proc_desc in let loc = Procdesc.get_loc proc_desc in
let err_desc = Localise.desc_custom_error loc in let err_desc = Localise.desc_custom_error loc in
let exn = Exceptions.Custom_error (custom_error, Error, err_desc) in let exn = Exceptions.Custom_error (custom_error, Error, err_desc) in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log Error exn BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn
in in
List.iter ~f:report error_preconditions List.iter ~f:report error_preconditions
@ -1124,5 +1124,5 @@ let analyze_procedure ({InterproceduralAnalysis.proc_desc; err_log} as analysis_
try Some (analyze_procedure_aux analysis_data) try Some (analyze_procedure_aux analysis_data)
with exn -> with exn ->
IExn.reraise_if exn ~f:(fun () -> not (Exceptions.handle_exception exn)) ; IExn.reraise_if exn ~f:(fun () -> not (Exceptions.handle_exception exn)) ;
BiabductionReporting.log_error_using_state proc_desc err_log exn ; BiabductionReporting.log_issue_using_state proc_desc err_log exn ;
None None

@ -640,8 +640,7 @@ let make_trace ~report_kind original_exp =
let log_issue current_pname ~issue_log ~loc ~ltr ~access issue_type error_message = let log_issue current_pname ~issue_log ~loc ~ltr ~access issue_type error_message =
Reporting.log_issue_external current_pname Warning ~issue_log ~loc ~ltr ~access issue_type Reporting.log_issue_external current_pname ~issue_log ~loc ~ltr ~access issue_type error_message
error_message
type reported_access = type reported_access =

@ -470,7 +470,7 @@ end = struct
let issue_log_of loc_map = let issue_log_of loc_map =
let log_report ~issue_log loc {problem; pname; ltr; message} = let log_report ~issue_log loc {problem; pname; ltr; message} =
let issue_type = issue_type_of_problem problem in let issue_type = issue_type_of_problem problem in
Reporting.log_issue_external ~issue_log pname Error ~loc ~ltr Starvation issue_type message Reporting.log_issue_external ~issue_log pname ~loc ~ltr Starvation issue_type message
in in
let mk_deduped_report ({message} as report) = let mk_deduped_report ({message} as report) =
{ report with { report with

@ -13,8 +13,8 @@ let log_issue ?proc_name ~issue_log ~loc ~severity ~nullsafe_extra issue_type er
in in
let proc_name = Option.value proc_name ~default:Procname.Linters_dummy_method in let proc_name = Option.value proc_name ~default:Procname.Linters_dummy_method in
let trace = [Errlog.make_trace_element 0 loc error_message []] in let trace = [Errlog.make_trace_element 0 loc error_message []] in
Reporting.log_issue_external proc_name severity ~issue_log ~loc ~extras ~ltr:trace Eradicate Reporting.log_issue_external proc_name ~severity_override:severity ~issue_log ~loc ~extras
issue_type error_message ~ltr:trace Eradicate issue_type error_message
(* If the issue is related to violation of nullability type system rules *) (* If the issue is related to violation of nullability type system rules *)

@ -17,6 +17,6 @@ let report_error {IntraproceduralAnalysis.proc_desc; tenv; err_log} checker kind
let trace = [Errlog.make_trace_element 0 loc description []] in let trace = [Errlog.make_trace_element 0 loc description []] in
let node = AnalysisState.get_node_exn () in let node = AnalysisState.get_node_exn () in
let session = AnalysisState.get_session () in let session = AnalysisState.get_session () in
Reporting.log_issue_from_summary severity proc_desc err_log Reporting.log_issue_from_summary ~severity_override:severity proc_desc err_log
~node:(BackendNode {node}) ~node:(BackendNode {node})
~session ~loc ~ltr:trace checker exn ~session ~loc ~ltr:trace checker exn

Loading…
Cancel
Save