|
|
|
@ -12,23 +12,23 @@ type log_t =
|
|
|
|
|
?ltr:Errlog.loc_trace -> ?linters_def_file:string -> ?doc_url:string -> ?access:string
|
|
|
|
|
-> ?extras:Jsonbug_t.extra -> exn -> unit
|
|
|
|
|
|
|
|
|
|
let log_issue_from_errlog procname ~clang_method_kind severity err_log ~loc ~node_id_key ~ltr
|
|
|
|
|
let log_issue_from_errlog procname ~clang_method_kind severity err_log ~loc ~node ~ltr
|
|
|
|
|
~linters_def_file ~doc_url ~access ~extras exn =
|
|
|
|
|
let issue_type = (Exceptions.recognize_exception exn).name in
|
|
|
|
|
if not Config.filtering (* no-filtering takes priority *) || issue_type.IssueType.enabled then
|
|
|
|
|
let session = (State.get_session () :> int) in
|
|
|
|
|
Errlog.log_issue procname ~clang_method_kind severity err_log ~loc ~node_id_key ~session ~ltr
|
|
|
|
|
Errlog.log_issue procname ~clang_method_kind severity err_log ~loc ~node ~session ~ltr
|
|
|
|
|
~linters_def_file ~doc_url ~access ~extras exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let log_frontend_issue procname severity errlog ~loc ~node_key ~ltr ~linters_def_file ~doc_url exn =
|
|
|
|
|
let node_id_key = Errlog.FrontendNode {node_key} in
|
|
|
|
|
log_issue_from_errlog procname ~clang_method_kind:None severity errlog ~loc ~node_id_key ~ltr
|
|
|
|
|
let node = Errlog.FrontendNode {node_key} in
|
|
|
|
|
log_issue_from_errlog procname ~clang_method_kind:None severity errlog ~loc ~node ~ltr
|
|
|
|
|
~linters_def_file ~doc_url ~access:None ~extras:None exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let log_issue_from_summary severity summary ~node_id_key ~loc ?ltr ?linters_def_file ?doc_url
|
|
|
|
|
?access ?extras exn =
|
|
|
|
|
let log_issue_from_summary severity summary ~node ~loc ?ltr ?linters_def_file ?doc_url ?access
|
|
|
|
|
?extras exn =
|
|
|
|
|
let attrs = Summary.get_attributes summary in
|
|
|
|
|
let procname = attrs.proc_name in
|
|
|
|
|
let is_java_generated_method =
|
|
|
|
@ -48,20 +48,19 @@ let log_issue_from_summary severity summary ~node_id_key ~loc ?ltr ?linters_def_
|
|
|
|
|
let err_log = Summary.get_err_log summary in
|
|
|
|
|
let clang_method_kind = Some attrs.clang_method_kind in
|
|
|
|
|
let ltr = match ltr with None -> State.get_loc_trace () | Some ltr -> ltr in
|
|
|
|
|
log_issue_from_errlog procname ~clang_method_kind severity err_log ~loc ~node_id_key ~ltr
|
|
|
|
|
let node = Errlog.BackendNode {node} in
|
|
|
|
|
log_issue_from_errlog procname ~clang_method_kind severity err_log ~loc ~node ~ltr
|
|
|
|
|
~linters_def_file ~doc_url ~access ~extras exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let log_issue_deprecated severity proc_name ?node_id_key ?loc ?ltr ?linters_def_file ?doc_url
|
|
|
|
|
?access ?extras:_ exn =
|
|
|
|
|
let log_issue_deprecated severity proc_name ?node ?loc ?ltr ?linters_def_file ?doc_url ?access
|
|
|
|
|
?extras:_ exn =
|
|
|
|
|
match Summary.get proc_name with
|
|
|
|
|
| Some summary ->
|
|
|
|
|
let node_id_key =
|
|
|
|
|
match node_id_key with None -> State.get_node_id_key () | Some node_id_key -> node_id_key
|
|
|
|
|
in
|
|
|
|
|
let node = match node with None -> State.get_node () | Some node -> node in
|
|
|
|
|
let loc = match loc with None -> State.get_loc () | Some loc -> loc in
|
|
|
|
|
log_issue_from_summary severity summary ~node_id_key ~loc ?ltr ?linters_def_file ?doc_url
|
|
|
|
|
?access exn
|
|
|
|
|
log_issue_from_summary severity summary ~node ~loc ?ltr ?linters_def_file ?doc_url ?access
|
|
|
|
|
exn
|
|
|
|
|
| None ->
|
|
|
|
|
L.(die InternalError)
|
|
|
|
|
"Trying to report error on procedure %a, but cannot because no summary exists for this \
|
|
|
|
@ -71,8 +70,8 @@ let log_issue_deprecated severity proc_name ?node_id_key ?loc ?ltr ?linters_def_
|
|
|
|
|
|
|
|
|
|
let log_issue_from_summary_simplified severity summary ~loc ?ltr ?linters_def_file ?doc_url ?access
|
|
|
|
|
?extras exn =
|
|
|
|
|
let node_id_key = State.get_node_id_key () in
|
|
|
|
|
log_issue_from_summary severity summary ~node_id_key ~loc ?ltr ?linters_def_file ?doc_url ?access
|
|
|
|
|
let node = State.get_node () in
|
|
|
|
|
log_issue_from_summary severity summary ~node ~loc ?ltr ?linters_def_file ?doc_url ?access
|
|
|
|
|
?extras exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -82,8 +81,8 @@ let log_warning = log_issue_from_summary_simplified Exceptions.Warning
|
|
|
|
|
|
|
|
|
|
let log_issue_external procname severity ~loc ~ltr ?access exn =
|
|
|
|
|
let errlog = IssueLog.get_errlog procname in
|
|
|
|
|
let node_id_key = State.get_node_id_key () in
|
|
|
|
|
log_issue_from_errlog procname ~clang_method_kind:None severity errlog ~loc ~node_id_key ~ltr
|
|
|
|
|
let node = Errlog.BackendNode {node= State.get_node ()} in
|
|
|
|
|
log_issue_from_errlog procname ~clang_method_kind:None severity errlog ~loc ~node ~ltr
|
|
|
|
|
~linters_def_file:None ~doc_url:None ~access ~extras:None exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|