diff --git a/infer/src/absint/Reporting.ml b/infer/src/absint/Reporting.ml index 8519714a8..85a616e92 100644 --- a/infer/src/absint/Reporting.ml +++ b/infer/src/absint/Reporting.ml @@ -65,14 +65,8 @@ let log_issue_from_summary_simplified ?severity_override attrs err_log ~loc ?(lt ~ltr ?extras checker exn -let log_error attrs err_log ~loc ?ltr ?extras checker issue_type error_message = - log_issue_from_summary_simplified ~severity_override:Error 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 ~severity_override:Warning attrs err_log ~loc ?ltr ?extras - checker issue_type error_message +let log_issue attrs err_log ~loc ?ltr ?extras checker issue_type error_message = + log_issue_from_summary_simplified attrs err_log ~loc ?ltr ?extras checker issue_type error_message let log_issue_external procname ~issue_log ?severity_override ~loc ~ltr ?access ?extras checker diff --git a/infer/src/absint/Reporting.mli b/infer/src/absint/Reporting.mli index 5ae6b7fae..680fecd5f 100644 --- a/infer/src/absint/Reporting.mli +++ b/infer/src/absint/Reporting.mli @@ -29,11 +29,8 @@ val log_frontend_issue : 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. *) -val log_error : Procdesc.t -> Errlog.t -> loc:Location.t -> log_t -(** Add an error to the given error log. *) - -val log_warning : Procdesc.t -> Errlog.t -> loc:Location.t -> log_t -(** Add a warning to the given error log. *) +val log_issue : Procdesc.t -> Errlog.t -> loc:Location.t -> log_t +(** Add an issue to the given error log. *) val log_issue_external : Procname.t diff --git a/infer/src/bufferoverrun/bufferOverrunChecker.ml b/infer/src/bufferoverrun/bufferOverrunChecker.ml index 8ade46342..f19ee9140 100644 --- a/infer/src/bufferoverrun/bufferOverrunChecker.ml +++ b/infer/src/bufferoverrun/bufferOverrunChecker.ml @@ -37,7 +37,7 @@ module UnusedBranch = struct if true_branch then IssueType.condition_always_false else IssueType.condition_always_true in let ltr = [Errlog.make_trace_element 0 location "Here" []] in - Reporting.log_warning proc_desc err_log ~loc:location ~ltr BufferOverrunChecker issue_type desc + Reporting.log_issue proc_desc err_log ~loc:location ~ltr BufferOverrunChecker issue_type desc end module UnusedBranches = struct @@ -54,7 +54,7 @@ module UnreachableStatement = struct let report {InterproceduralAnalysis.proc_desc; err_log} {location} = let ltr = [Errlog.make_trace_element 0 location "Here" []] in - Reporting.log_error proc_desc err_log ~loc:location ~ltr BufferOverrunChecker + Reporting.log_issue proc_desc err_log ~loc:location ~ltr BufferOverrunChecker IssueType.unreachable_code_after "Unreachable code after statement" end @@ -417,7 +417,7 @@ let report_errors ({InterproceduralAnalysis.proc_desc; err_log} as analysis_data Trace.Issue.make_err_trace ~description (PO.ConditionTrace.get_val_traces trace) |> Errlog.concat_traces in - Reporting.log_error proc_desc err_log ~loc:location ~ltr:trace BufferOverrunChecker issue_type + Reporting.log_issue proc_desc err_log ~loc:location ~ltr:trace BufferOverrunChecker issue_type (description ~markup:true) in PO.ConditionSet.report_errors ~report cond_set diff --git a/infer/src/checkers/RequiredProps.ml b/infer/src/checkers/RequiredProps.ml index ff11acee2..214d1f947 100644 --- a/infer/src/checkers/RequiredProps.ml +++ b/infer/src/checkers/RequiredProps.ml @@ -82,7 +82,7 @@ let report_missing_required_prop proc_desc err_log prop parent_typename ~create_ in Errlog.make_trace_element 0 location call_msg [] ) in - Reporting.log_error proc_desc err_log ~loc:create_loc ~ltr LithoRequiredProps + Reporting.log_issue proc_desc err_log ~loc:create_loc ~ltr LithoRequiredProps IssueType.missing_required_prop message diff --git a/infer/src/checkers/SelfInBlock.ml b/infer/src/checkers/SelfInBlock.ml index 6392f6ea9..ccfdf32cf 100644 --- a/infer/src/checkers/SelfInBlock.ml +++ b/infer/src/checkers/SelfInBlock.ml @@ -240,7 +240,7 @@ module TransferFunctions = struct (Pvar.pp Pp.text) pvar var_use Location.pp loc in let ltr = make_trace_unchecked_strongself domain in - Reporting.log_error proc_desc err_log ~ltr ~loc SelfInBlock + Reporting.log_issue proc_desc err_log ~ltr ~loc SelfInBlock IssueType.strong_self_not_checked message ; let strongVars = StrongEqualToWeakCapturedVars.add pvar @@ -437,7 +437,7 @@ 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_error proc_desc err_log ~ltr ~loc:self.loc SelfInBlock IssueType.mixed_self_weakself + Reporting.log_issue proc_desc err_log ~ltr ~loc:self.loc SelfInBlock IssueType.mixed_self_weakself message @@ -455,7 +455,7 @@ let report_weakself_in_no_escape_block_issues proc_desc err_log domain (weakSelf (Procname.to_simplified_string procname) in let ltr = make_trace_use_self_weakself domain in - Reporting.log_error proc_desc err_log ~ltr ~loc:weakSelf.loc SelfInBlock + Reporting.log_issue proc_desc err_log ~ltr ~loc:weakSelf.loc SelfInBlock IssueType.weak_self_in_noescape_block message ; reported_weak_self_in_noescape_block ) else reported_weak_self_in_noescape_block @@ -473,7 +473,7 @@ let report_weakself_multiple_issue proc_desc err_log domain (weakSelf1 : DomainD (Pvar.pp Pp.text) weakSelf1.pvar (Pvar.pp Pp.text) weakSelf1.pvar in let ltr = make_trace_use_self_weakself domain in - Reporting.log_error proc_desc err_log ~ltr ~loc:weakSelf1.loc SelfInBlock + Reporting.log_issue proc_desc err_log ~ltr ~loc:weakSelf1.loc SelfInBlock IssueType.multiple_weakself message @@ -495,7 +495,7 @@ let report_captured_strongself_issue proc_desc err_log domain (capturedStrongSel (Pvar.pp Pp.text) capturedStrongSelf.pvar Location.pp capturedStrongSelf.loc in let ltr = make_trace_captured_strong_self domain in - Reporting.log_error proc_desc err_log ~ltr ~loc:capturedStrongSelf.loc SelfInBlock + Reporting.log_issue proc_desc err_log ~ltr ~loc:capturedStrongSelf.loc SelfInBlock IssueType.captured_strong_self message ; report_captured_strongself ) else report_captured_strongself diff --git a/infer/src/checkers/Siof.ml b/infer/src/checkers/Siof.ml index b5f724103..f84680578 100644 --- a/infer/src/checkers/Siof.ml +++ b/infer/src/checkers/Siof.ml @@ -231,7 +231,7 @@ let report_siof {InterproceduralAnalysis.proc_desc; err_log; analyze_dependency; GlobalVar.pp (SiofTrace.Sink.kind final_sink) in let ltr = SiofTrace.trace_of_error loc gname trace in - Reporting.log_error proc_desc err_log ~loc ~ltr SIOF + Reporting.log_issue proc_desc err_log ~loc ~ltr SIOF IssueType.static_initialization_order_fiasco description in let reportable_paths = SiofTrace.get_reportable_sink_paths trace ~trace_of_pname in diff --git a/infer/src/checkers/annotationReachability.ml b/infer/src/checkers/annotationReachability.ml index aa3acdda0..c7df6abb6 100644 --- a/infer/src/checkers/annotationReachability.ml +++ b/infer/src/checkers/annotationReachability.ml @@ -85,7 +85,7 @@ let report_allocation_stack {InterproceduralAnalysis.proc_desc; err_log} src_ann MF.pp_monospaced ("@" ^ src_annot) MF.pp_monospaced constr_str MF.pp_monospaced ("new " ^ constr_str) in - Reporting.log_error proc_desc err_log ~loc:fst_call_loc ~ltr:final_trace AnnotationReachability + Reporting.log_issue proc_desc err_log ~loc:fst_call_loc ~ltr:final_trace AnnotationReachability IssueType.checkers_allocates_memory description @@ -109,7 +109,7 @@ let report_annotation_stack ({InterproceduralAnalysis.proc_desc; err_log} as ana IssueType.checkers_calls_expensive_method else IssueType.checkers_annotation_reachability_error in - Reporting.log_error proc_desc err_log ~loc ~ltr:final_trace AnnotationReachability issue_type + Reporting.log_issue proc_desc err_log ~loc ~ltr:final_trace AnnotationReachability issue_type description @@ -334,7 +334,7 @@ module CxxAnnotationSpecs = struct IssueType.register_from_string ~id:spec_name ~doc_url ~linters_def_file Error AnnotationReachability in - Reporting.log_error proc_desc err_log ~loc ~ltr:final_trace AnnotationReachability issue_type + Reporting.log_issue proc_desc err_log ~loc ~ltr:final_trace AnnotationReachability issue_type description in let snk_annot = annotation_of_str snk_name in @@ -413,7 +413,7 @@ module ExpensiveAnnotationSpec = struct (Procname.to_string overridden_pname) MF.pp_monospaced ("@" ^ Annotations.expensive) in - Reporting.log_error proc_desc err_log ~loc AnnotationReachability + Reporting.log_issue proc_desc err_log ~loc AnnotationReachability IssueType.checkers_expensive_overrides_unexpensive description diff --git a/infer/src/checkers/classLoads.ml b/infer/src/checkers/classLoads.ml index 716672e35..a1222e628 100644 --- a/infer/src/checkers/classLoads.ml +++ b/infer/src/checkers/classLoads.ml @@ -112,7 +112,7 @@ let report_loads {InterproceduralAnalysis.proc_desc; err_log} astate = else let ltr = ClassLoadsDomain.Event.make_loc_trace event in let msg = Format.asprintf "Class %s loaded" elem in - Reporting.log_warning proc_desc err_log ~loc ~ltr ClassLoads IssueType.class_load msg + Reporting.log_issue proc_desc err_log ~loc ~ltr ClassLoads IssueType.class_load msg in let pname = Procdesc.get_proc_name proc_desc in Procname.get_class_name pname diff --git a/infer/src/checkers/fragmentRetainsViewChecker.ml b/infer/src/checkers/fragmentRetainsViewChecker.ml index ee559cbe2..bb82e7225 100644 --- a/infer/src/checkers/fragmentRetainsViewChecker.ml +++ b/infer/src/checkers/fragmentRetainsViewChecker.ml @@ -43,7 +43,7 @@ let report_warning proc_desc err_log class_name fld fld_typ = (format_method (Procdesc.get_proc_name proc_desc)) pp_m on_create_view pp_m on_destroy_view in - Reporting.log_warning proc_desc err_log ~loc:(Procdesc.get_loc proc_desc) FragmentRetainsView + Reporting.log_issue proc_desc err_log ~loc:(Procdesc.get_loc proc_desc) FragmentRetainsView IssueType.checkers_fragment_retain_view description diff --git a/infer/src/checkers/impurity.ml b/infer/src/checkers/impurity.ml index bd0055e81..16f9a0e6a 100644 --- a/infer/src/checkers/impurity.ml +++ b/infer/src/checkers/impurity.ml @@ -170,14 +170,14 @@ let checker {IntraproceduralAnalysis.proc_desc; tenv; err_log} pulse_summary_opt F.asprintf "Impure function %a with no pulse summary" Procname.pp proc_name in let impure_fun_ltr = Errlog.make_trace_element 0 pname_loc impure_fun_desc [] in - Reporting.log_error proc_desc err_log ~loc:pname_loc ~ltr:[impure_fun_ltr] Impurity + Reporting.log_issue proc_desc err_log ~loc:pname_loc ~ltr:[impure_fun_ltr] Impurity IssueType.impure_function impure_fun_desc | Some [] -> let impure_fun_desc = F.asprintf "Impure function %a with empty pulse summary" Procname.pp proc_name in let impure_fun_ltr = Errlog.make_trace_element 0 pname_loc impure_fun_desc [] in - Reporting.log_error proc_desc err_log ~loc:pname_loc ~ltr:[impure_fun_ltr] Impurity + Reporting.log_issue proc_desc err_log ~loc:pname_loc ~ltr:[impure_fun_ltr] Impurity IssueType.impure_function impure_fun_desc | Some pre_posts -> let (ImpurityDomain.{modified_globals; modified_params; skipped_calls} as impurity_astate) = @@ -207,5 +207,5 @@ let checker {IntraproceduralAnalysis.proc_desc; tenv; err_log} pulse_summary_opt :: modified_ltr Formal modified_params (modified_ltr Global modified_globals skipped_functions) in - Reporting.log_error proc_desc err_log ~loc:pname_loc ~ltr Impurity IssueType.impure_function + Reporting.log_issue proc_desc err_log ~loc:pname_loc ~ltr Impurity IssueType.impure_function impure_fun_desc diff --git a/infer/src/checkers/inefficientKeysetIterator.ml b/infer/src/checkers/inefficientKeysetIterator.ml index 2c47bf385..44fc268bb 100644 --- a/infer/src/checkers/inefficientKeysetIterator.ml +++ b/infer/src/checkers/inefficientKeysetIterator.ml @@ -75,7 +75,7 @@ let report_matching_get proc_desc err_log tenv pvar loop_nodes : unit = in let loc = Procdesc.Node.get_loc node in let ltr = [Errlog.make_trace_element 0 loc exp_desc []] in - Reporting.log_error proc_desc err_log ~loc ~ltr InefficientKeysetIterator + Reporting.log_issue proc_desc err_log ~loc ~ltr InefficientKeysetIterator IssueType.inefficient_keyset_iterator exp_desc ) ) ) loop_nodes diff --git a/infer/src/checkers/liveness.ml b/infer/src/checkers/liveness.ml index 672fb8043..fb92a0c1e 100644 --- a/infer/src/checkers/liveness.ml +++ b/infer/src/checkers/liveness.ml @@ -256,7 +256,7 @@ let checker {IntraproceduralAnalysis.proc_desc; err_log} = (Typ.pp_full Pp.text) typ in let ltr = [Errlog.make_trace_element 0 loc "Write of unused value" []] in - Reporting.log_error proc_desc err_log ~loc ~ltr Liveness IssueType.dead_store message + Reporting.log_issue proc_desc err_log ~loc ~ltr Liveness IssueType.dead_store message in let report_dead_store live_vars captured_by_ref_vars = function | Sil.Store {e1= Lvar pvar; typ; e2= rhs_exp; loc} diff --git a/infer/src/checkers/printfArgs.ml b/infer/src/checkers/printfArgs.ml index 506deda93..8d61022bd 100644 --- a/infer/src/checkers/printfArgs.ml +++ b/infer/src/checkers/printfArgs.ml @@ -111,7 +111,7 @@ let check_printf_args_ok tenv (node : Procdesc.Node.t) (instr : Sil.instr) (proc "%s at line %s: parameter %d is expected to be of type %s but %s was given." instr_name instr_line n_arg (default_format_type_name ft) gt in - Reporting.log_error proc_desc err_log ~loc:instr_loc PrintfArgs + Reporting.log_issue proc_desc err_log ~loc:instr_loc PrintfArgs IssueType.checkers_printf_args description else check_type_names instr_loc (n_arg + 1) instr_proc_name fs gs | [], [] -> @@ -121,7 +121,7 @@ let check_printf_args_ok tenv (node : Procdesc.Node.t) (instr : Sil.instr) (proc Printf.sprintf "format string arguments don't mach provided arguments in %s at line %s" instr_name instr_line in - Reporting.log_error proc_desc err_log ~loc:instr_loc PrintfArgs + Reporting.log_issue proc_desc err_log ~loc:instr_loc PrintfArgs IssueType.checkers_printf_args description in (* Get the array ivar for a given nvar *) @@ -158,7 +158,7 @@ let check_printf_args_ok tenv (node : Procdesc.Node.t) (instr : Sil.instr) (proc vararg_ivar_type_names | None -> if not (Reporting.is_suppressed tenv proc_desc IssueType.checkers_printf_args) then - Reporting.log_warning proc_desc err_log ~loc:cl PrintfArgs + Reporting.log_issue proc_desc err_log ~loc:cl PrintfArgs IssueType.checkers_printf_args "Format string must be string literal" with e -> L.internal_error "%s Exception when analyzing %s: %s@." diff --git a/infer/src/checkers/purity.ml b/infer/src/checkers/purity.ml index f5307b43b..de7195488 100644 --- a/infer/src/checkers/purity.ml +++ b/infer/src/checkers/purity.ml @@ -201,7 +201,7 @@ let report_errors {InterproceduralAnalysis.proc_desc; err_log} astate_opt = let loc = Procdesc.get_loc proc_desc in let exp_desc = F.asprintf "Side-effect free function %a" Procname.pp proc_name in let ltr = [Errlog.make_trace_element 0 loc exp_desc []] in - Reporting.log_error proc_desc err_log ~loc ~ltr Purity IssueType.pure_function exp_desc + Reporting.log_issue proc_desc err_log ~loc ~ltr Purity IssueType.pure_function exp_desc | None -> L.internal_error "Analyzer failed to compute purity information for %a@." Procname.pp proc_name diff --git a/infer/src/checkers/uninit.ml b/infer/src/checkers/uninit.ml index df3dd64e3..9f26857a0 100644 --- a/infer/src/checkers/uninit.ml +++ b/infer/src/checkers/uninit.ml @@ -78,7 +78,7 @@ module TransferFunctions (CFG : ProcCfg.S) = struct access_expr in let ltr = [Errlog.make_trace_element 0 loc "" []] in - Reporting.log_error proc_desc err_log ~loc ~ltr Uninit IssueType.uninitialized_value message + Reporting.log_issue proc_desc err_log ~loc ~ltr Uninit IssueType.uninitialized_value message let is_struct t = match t.Typ.desc with Typ.Tstruct _ -> true | _ -> false diff --git a/infer/src/cost/cost.ml b/infer/src/cost/cost.ml index 11d12c85b..58ac4d604 100644 --- a/infer/src/cost/cost.ml +++ b/infer/src/cost/cost.ml @@ -186,7 +186,7 @@ module Check = struct {CostIssues.unreachable_issue; infinite_issue} = let report issue suffix = let message = F.asprintf "%s of the function %a %s" name Procname.pp pname suffix in - Reporting.log_error proc_desc err_log ~loc + Reporting.log_issue proc_desc err_log ~loc ~ltr:(BasicCost.polynomial_traces cost) ~extras:(compute_errlog_extras cost) Cost issue message in diff --git a/infer/src/cost/hoisting.ml b/infer/src/cost/hoisting.ml index e1babed92..181a99848 100644 --- a/infer/src/cost/hoisting.ml +++ b/infer/src/cost/hoisting.ml @@ -96,7 +96,7 @@ let do_report extract_cost_if_expensive proc_desc err_log (Call.{pname; loc} as F.asprintf "%s%s. It can be moved out of the loop at %a." exp_desc cost_msg Location.pp loop_head_loc in - Reporting.log_error proc_desc err_log ~loc ~ltr LoopHoisting issue message + Reporting.log_issue proc_desc err_log ~loc ~ltr LoopHoisting issue message let get_cost_if_expensive tenv integer_type_widths get_callee_cost_summary_and_formals diff --git a/infer/src/labs/00_dummy_checker/ResourceLeaks.ml b/infer/src/labs/00_dummy_checker/ResourceLeaks.ml index 4494bc443..12174047b 100644 --- a/infer/src/labs/00_dummy_checker/ResourceLeaks.ml +++ b/infer/src/labs/00_dummy_checker/ResourceLeaks.ml @@ -81,7 +81,7 @@ let report_if_leak {InterproceduralAnalysis.proc_desc; err_log; _} post = if change_me then let last_loc = Procdesc.Node.get_loc (Procdesc.get_exit_node proc_desc) in let message = F.asprintf "Leaked %a resource(s)" ResourceLeakDomain.pp post in - Reporting.log_error proc_desc err_log ~loc:last_loc ResourceLeakLabExercise + Reporting.log_issue proc_desc err_log ~loc:last_loc ResourceLeakLabExercise IssueType.lab_resource_leak message diff --git a/infer/src/labs/01_integer_domain/ResourceLeaks.ml b/infer/src/labs/01_integer_domain/ResourceLeaks.ml index cbe120f2c..b702f2089 100644 --- a/infer/src/labs/01_integer_domain/ResourceLeaks.ml +++ b/infer/src/labs/01_integer_domain/ResourceLeaks.ml @@ -83,7 +83,7 @@ let report_if_leak {InterproceduralAnalysis.proc_desc; err_log; _} post = if ResourceLeakDomain.has_leak post then let last_loc = Procdesc.Node.get_loc (Procdesc.get_exit_node proc_desc) in let message = F.asprintf "Leaked %a resource(s)" ResourceLeakDomain.pp post in - Reporting.log_error proc_desc err_log ~loc:last_loc ResourceLeakLabExercise + Reporting.log_issue proc_desc err_log ~loc:last_loc ResourceLeakLabExercise IssueType.lab_resource_leak message diff --git a/infer/src/labs/02_domain_join/ResourceLeaks.ml b/infer/src/labs/02_domain_join/ResourceLeaks.ml index cbe120f2c..b702f2089 100644 --- a/infer/src/labs/02_domain_join/ResourceLeaks.ml +++ b/infer/src/labs/02_domain_join/ResourceLeaks.ml @@ -83,7 +83,7 @@ let report_if_leak {InterproceduralAnalysis.proc_desc; err_log; _} post = if ResourceLeakDomain.has_leak post then let last_loc = Procdesc.Node.get_loc (Procdesc.get_exit_node proc_desc) in let message = F.asprintf "Leaked %a resource(s)" ResourceLeakDomain.pp post in - Reporting.log_error proc_desc err_log ~loc:last_loc ResourceLeakLabExercise + Reporting.log_issue proc_desc err_log ~loc:last_loc ResourceLeakLabExercise IssueType.lab_resource_leak message diff --git a/infer/src/labs/03_domain_top/ResourceLeaks.ml b/infer/src/labs/03_domain_top/ResourceLeaks.ml index cbe120f2c..b702f2089 100644 --- a/infer/src/labs/03_domain_top/ResourceLeaks.ml +++ b/infer/src/labs/03_domain_top/ResourceLeaks.ml @@ -83,7 +83,7 @@ let report_if_leak {InterproceduralAnalysis.proc_desc; err_log; _} post = if ResourceLeakDomain.has_leak post then let last_loc = Procdesc.Node.get_loc (Procdesc.get_exit_node proc_desc) in let message = F.asprintf "Leaked %a resource(s)" ResourceLeakDomain.pp post in - Reporting.log_error proc_desc err_log ~loc:last_loc ResourceLeakLabExercise + Reporting.log_issue proc_desc err_log ~loc:last_loc ResourceLeakLabExercise IssueType.lab_resource_leak message diff --git a/infer/src/labs/04_interprocedural/ResourceLeaks.ml b/infer/src/labs/04_interprocedural/ResourceLeaks.ml index d84c459c2..a67169802 100644 --- a/infer/src/labs/04_interprocedural/ResourceLeaks.ml +++ b/infer/src/labs/04_interprocedural/ResourceLeaks.ml @@ -96,7 +96,7 @@ let report_if_leak {InterproceduralAnalysis.proc_desc; err_log; _} post = if ResourceLeakDomain.has_leak post then let last_loc = Procdesc.Node.get_loc (Procdesc.get_exit_node proc_desc) in let message = F.asprintf "Leaked %a resource(s)" ResourceLeakDomain.pp post in - Reporting.log_error proc_desc err_log ~loc:last_loc ResourceLeakLabExercise + Reporting.log_issue proc_desc err_log ~loc:last_loc ResourceLeakLabExercise IssueType.lab_resource_leak message diff --git a/infer/src/labs/05_access_paths_interprocedural/ResourceLeaks.ml b/infer/src/labs/05_access_paths_interprocedural/ResourceLeaks.ml index 96a355553..335a463a1 100644 --- a/infer/src/labs/05_access_paths_interprocedural/ResourceLeaks.ml +++ b/infer/src/labs/05_access_paths_interprocedural/ResourceLeaks.ml @@ -103,7 +103,7 @@ let report_if_leak {InterproceduralAnalysis.proc_desc; err_log; _} formal_map po if ResourceLeakDomain.has_leak formal_map post then let last_loc = Procdesc.Node.get_loc (Procdesc.get_exit_node proc_desc) in let message = F.asprintf "Leaked %a resource(s)" ResourceLeakDomain.pp post in - Reporting.log_error proc_desc err_log ~loc:last_loc ResourceLeakLabExercise + Reporting.log_issue proc_desc err_log ~loc:last_loc ResourceLeakLabExercise IssueType.lab_resource_leak message diff --git a/infer/src/labs/ResourceLeaks.ml b/infer/src/labs/ResourceLeaks.ml index 4494bc443..12174047b 100644 --- a/infer/src/labs/ResourceLeaks.ml +++ b/infer/src/labs/ResourceLeaks.ml @@ -81,7 +81,7 @@ let report_if_leak {InterproceduralAnalysis.proc_desc; err_log; _} post = if change_me then let last_loc = Procdesc.Node.get_loc (Procdesc.get_exit_node proc_desc) in let message = F.asprintf "Leaked %a resource(s)" ResourceLeakDomain.pp post in - Reporting.log_error proc_desc err_log ~loc:last_loc ResourceLeakLabExercise + Reporting.log_issue proc_desc err_log ~loc:last_loc ResourceLeakLabExercise IssueType.lab_resource_leak message diff --git a/infer/src/pulse/Pulse.ml b/infer/src/pulse/Pulse.ml index ba36f9687..00cfa14b0 100644 --- a/infer/src/pulse/Pulse.ml +++ b/infer/src/pulse/Pulse.ml @@ -14,7 +14,7 @@ open PulseDomainInterface let report {InterproceduralAnalysis.proc_desc; err_log} diagnostic = let open Diagnostic in - Reporting.log_error proc_desc err_log ~loc:(get_location diagnostic) ~ltr:(get_trace diagnostic) + Reporting.log_issue proc_desc err_log ~loc:(get_location diagnostic) ~ltr:(get_trace diagnostic) Pulse (get_issue_type diagnostic) (get_message diagnostic) diff --git a/infer/src/quandary/TaintAnalysis.ml b/infer/src/quandary/TaintAnalysis.ml index afa8c6add..0c22c70af 100644 --- a/infer/src/quandary/TaintAnalysis.ml +++ b/infer/src/quandary/TaintAnalysis.ml @@ -298,7 +298,7 @@ module Make (TaintSpecification : TaintSpec.S) = struct get_short_trace_string initial_source initial_source_caller final_sink final_sink_caller in let ltr = source_trace @ List.rev sink_trace in - Reporting.log_error proc_desc err_log ~loc:(CallSite.loc cur_site) ~ltr Quandary issue + Reporting.log_issue proc_desc err_log ~loc:(CallSite.loc cur_site) ~ltr Quandary issue trace_str in List.iter ~f:report_one (TraceDomain.get_reports ~cur_site trace) diff --git a/infer/src/topl/Topl.ml b/infer/src/topl/Topl.ml index 8b16f84bb..42f99b46c 100644 --- a/infer/src/topl/Topl.ml +++ b/infer/src/topl/Topl.ml @@ -282,7 +282,7 @@ let add_errors env proc_desc err_log biabduction_summary = let property, _vname = ToplAutomaton.vname (Lazy.force automaton) error in let message = Printf.sprintf "property %s reaches error" property in tt "WARN@\n" ; - Reporting.log_error proc_desc err_log TOPL IssueType.topl_error ~loc message ) + Reporting.log_issue proc_desc err_log TOPL IssueType.topl_error ~loc message ) in (* Don't warn if [lookup_static_var] fails. *) Option.iter ~f:handle_state_post_value (lookup_static_var env state_var post) diff --git a/infer/tests/codetoanalyze/java/checkers/issues.exp b/infer/tests/codetoanalyze/java/checkers/issues.exp index 050577c9e..3c50ba999 100644 --- a/infer/tests/codetoanalyze/java/checkers/issues.exp +++ b/infer/tests/codetoanalyze/java/checkers/issues.exp @@ -3,7 +3,7 @@ codetoanalyze/java/checkers/FragmentRetainsViewExample.java, codetoanalyze.java. codetoanalyze/java/checkers/FragmentRetainsViewExample.java, codetoanalyze.java.checkers.FragmentRetainsViewExample.onDestroyView():void, 0, CHECKERS_FRAGMENT_RETAINS_VIEW, no_bucket, WARNING, [] codetoanalyze/java/checkers/ImmutableCast.java, codetoanalyze.java.checkers.ImmutableCast.badCast(com.google.common.collect.ImmutableList):java.util.List, 0, CHECKERS_IMMUTABLE_CAST, no_bucket, WARNING, [Method badCast(...) returns class com.google.common.collect.ImmutableList but the return type is class java.util.List. Make sure that users of this method do not try to modify the collection.] codetoanalyze/java/checkers/ImmutableCast.java, codetoanalyze.java.checkers.ImmutableCast.badCastFromField():java.util.List, 0, CHECKERS_IMMUTABLE_CAST, no_bucket, WARNING, [Method badCastFromField() returns class com.google.common.collect.ImmutableList but the return type is class java.util.List. Make sure that users of this method do not try to modify the collection.] -codetoanalyze/java/checkers/PrintfArgsChecker.java, codetoanalyze.java.checkers.PrintfArgsChecker.formatStringIsNotLiteral(java.io.PrintStream):void, 2, CHECKERS_PRINTF_ARGS, no_bucket, WARNING, [] +codetoanalyze/java/checkers/PrintfArgsChecker.java, codetoanalyze.java.checkers.PrintfArgsChecker.formatStringIsNotLiteral(java.io.PrintStream):void, 2, CHECKERS_PRINTF_ARGS, no_bucket, ERROR, [] codetoanalyze/java/checkers/PrintfArgsChecker.java, codetoanalyze.java.checkers.PrintfArgsChecker.stringInsteadOfInteger(java.io.PrintStream):void, 1, CHECKERS_PRINTF_ARGS, no_bucket, ERROR, [] codetoanalyze/java/checkers/PrintfArgsChecker.java, codetoanalyze.java.checkers.PrintfArgsChecker.wrongNumberOfArguments(java.io.PrintStream):void, 1, CHECKERS_PRINTF_ARGS, no_bucket, ERROR, [] codetoanalyze/java/checkers/PrintfArgsChecker.java, codetoanalyze.java.checkers.SuppressedPrintfArgsChecker.classSuppressed(java.io.PrintStream):void, 1, CHECKERS_PRINTF_ARGS, no_bucket, ERROR, []