|
|
@ -9,26 +9,26 @@ open! IStd
|
|
|
|
module L = Logging
|
|
|
|
module L = Logging
|
|
|
|
|
|
|
|
|
|
|
|
type log_t =
|
|
|
|
type log_t =
|
|
|
|
?session:int -> ?ltr:Errlog.loc_trace -> ?linters_def_file:string -> ?doc_url:string
|
|
|
|
?ltr:Errlog.loc_trace -> ?linters_def_file:string -> ?doc_url:string -> ?access:string
|
|
|
|
-> ?access:string -> ?extras:Jsonbug_t.extra -> exn -> unit
|
|
|
|
-> ?extras:Jsonbug_t.extra -> exn -> unit
|
|
|
|
|
|
|
|
|
|
|
|
let log_issue_from_errlog_internal procname ~clang_method_kind severity err_log ~loc ~node_id_key
|
|
|
|
let log_issue_from_errlog_internal procname ~clang_method_kind severity err_log ~loc ~node_id_key
|
|
|
|
~session ~ltr ~linters_def_file ~doc_url ~access ~extras exn =
|
|
|
|
~ltr ~linters_def_file ~doc_url ~access ~extras exn =
|
|
|
|
let issue_type = (Exceptions.recognize_exception exn).name in
|
|
|
|
let issue_type = (Exceptions.recognize_exception exn).name 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 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_id_key ~session ~ltr
|
|
|
|
~linters_def_file ~doc_url ~access ~extras exn
|
|
|
|
~linters_def_file ~doc_url ~access ~extras exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let log_issue_from_errlog procname severity errlog ~loc ~node_id_key ~ltr ~linters_def_file
|
|
|
|
let log_issue_from_errlog procname severity errlog ~loc ~node_id_key ~ltr ~linters_def_file
|
|
|
|
~doc_url exn =
|
|
|
|
~doc_url exn =
|
|
|
|
let session = (State.get_session () :> int) in
|
|
|
|
|
|
|
|
log_issue_from_errlog_internal procname ~clang_method_kind:None severity errlog ~loc ~node_id_key
|
|
|
|
log_issue_from_errlog_internal procname ~clang_method_kind:None severity errlog ~loc ~node_id_key
|
|
|
|
~session ~ltr ~linters_def_file ~doc_url ~access:None ~extras:None exn
|
|
|
|
~ltr ~linters_def_file ~doc_url ~access:None ~extras:None exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let log_issue_from_summary severity summary ~node_id_key ~loc ?session ?ltr ?linters_def_file
|
|
|
|
let log_issue_from_summary severity summary ~node_id_key ~loc ?ltr ?linters_def_file ?doc_url
|
|
|
|
?doc_url ?access ?extras exn =
|
|
|
|
?access ?extras exn =
|
|
|
|
let attrs = Summary.get_attributes summary in
|
|
|
|
let attrs = Summary.get_attributes summary in
|
|
|
|
let procname = attrs.proc_name in
|
|
|
|
let procname = attrs.proc_name in
|
|
|
|
let is_java_generated_method =
|
|
|
|
let is_java_generated_method =
|
|
|
@ -47,24 +47,21 @@ let log_issue_from_summary severity summary ~node_id_key ~loc ?session ?ltr ?lin
|
|
|
|
else
|
|
|
|
else
|
|
|
|
let err_log = Summary.get_err_log summary in
|
|
|
|
let err_log = Summary.get_err_log summary in
|
|
|
|
let clang_method_kind = Some attrs.clang_method_kind in
|
|
|
|
let clang_method_kind = Some attrs.clang_method_kind in
|
|
|
|
let session =
|
|
|
|
|
|
|
|
match session with None -> (State.get_session () :> int) | Some session -> session
|
|
|
|
|
|
|
|
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
|
|
|
|
log_issue_from_errlog_internal procname ~clang_method_kind severity err_log ~loc ~node_id_key
|
|
|
|
log_issue_from_errlog_internal procname ~clang_method_kind severity err_log ~loc ~node_id_key
|
|
|
|
~session ~ltr ~linters_def_file ~doc_url ~access ~extras exn
|
|
|
|
~ltr ~linters_def_file ~doc_url ~access ~extras exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let log_issue_deprecated severity proc_name ?node_id_key ?loc ?session ?ltr ?linters_def_file
|
|
|
|
let log_issue_deprecated severity proc_name ?node_id_key ?loc ?ltr ?linters_def_file ?doc_url
|
|
|
|
?doc_url ?access ?extras:_ exn =
|
|
|
|
?access ?extras:_ exn =
|
|
|
|
match Summary.get proc_name with
|
|
|
|
match Summary.get proc_name with
|
|
|
|
| Some summary ->
|
|
|
|
| Some summary ->
|
|
|
|
let node_id_key =
|
|
|
|
let node_id_key =
|
|
|
|
match node_id_key with None -> State.get_node_id_key () | Some node_id_key -> node_id_key
|
|
|
|
match node_id_key with None -> State.get_node_id_key () | Some node_id_key -> node_id_key
|
|
|
|
in
|
|
|
|
in
|
|
|
|
let loc = match loc with None -> State.get_loc () | Some loc -> loc in
|
|
|
|
let loc = match loc with None -> State.get_loc () | Some loc -> loc in
|
|
|
|
log_issue_from_summary severity summary ~node_id_key ~loc ?session ?ltr ?linters_def_file
|
|
|
|
log_issue_from_summary severity summary ~node_id_key ~loc ?ltr ?linters_def_file ?doc_url
|
|
|
|
?doc_url ?access exn
|
|
|
|
?access exn
|
|
|
|
| None ->
|
|
|
|
| None ->
|
|
|
|
L.(die InternalError)
|
|
|
|
L.(die InternalError)
|
|
|
|
"Trying to report error on procedure %a, but cannot because no summary exists for this \
|
|
|
|
"Trying to report error on procedure %a, but cannot because no summary exists for this \
|
|
|
@ -72,11 +69,11 @@ let log_issue_deprecated severity proc_name ?node_id_key ?loc ?session ?ltr ?lin
|
|
|
|
Typ.Procname.pp proc_name Typ.Procname.pp proc_name
|
|
|
|
Typ.Procname.pp proc_name Typ.Procname.pp proc_name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let log_issue_from_summary_simplified severity summary ~loc ?session ?ltr ?linters_def_file
|
|
|
|
let log_issue_from_summary_simplified severity summary ~loc ?ltr ?linters_def_file ?doc_url ?access
|
|
|
|
?doc_url ?access ?extras exn =
|
|
|
|
?extras exn =
|
|
|
|
let node_id_key = State.get_node_id_key () in
|
|
|
|
let node_id_key = State.get_node_id_key () in
|
|
|
|
log_issue_from_summary severity summary ~node_id_key ~loc ?session ?ltr ?linters_def_file
|
|
|
|
log_issue_from_summary severity summary ~node_id_key ~loc ?ltr ?linters_def_file ?doc_url ?access
|
|
|
|
?doc_url ?access ?extras exn
|
|
|
|
?extras exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let log_error = log_issue_from_summary_simplified Exceptions.Error
|
|
|
|
let log_error = log_issue_from_summary_simplified Exceptions.Error
|
|
|
@ -86,9 +83,8 @@ let log_warning = log_issue_from_summary_simplified Exceptions.Warning
|
|
|
|
let log_issue_external procname severity ~loc ~ltr ?access exn =
|
|
|
|
let log_issue_external procname severity ~loc ~ltr ?access exn =
|
|
|
|
let errlog = IssueLog.get_errlog procname in
|
|
|
|
let errlog = IssueLog.get_errlog procname in
|
|
|
|
let node_id_key = State.get_node_id_key () in
|
|
|
|
let node_id_key = State.get_node_id_key () in
|
|
|
|
let session = (State.get_session () :> int) in
|
|
|
|
|
|
|
|
log_issue_from_errlog_internal procname ~clang_method_kind:None severity errlog ~loc ~node_id_key
|
|
|
|
log_issue_from_errlog_internal procname ~clang_method_kind:None severity errlog ~loc ~node_id_key
|
|
|
|
~session ~ltr ~linters_def_file:None ~doc_url:None ~access ~extras:None exn
|
|
|
|
~ltr ~linters_def_file:None ~doc_url:None ~access ~extras:None exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let is_suppressed ?(field_name= None) tenv proc_desc kind =
|
|
|
|
let is_suppressed ?(field_name= None) tenv proc_desc kind =
|
|
|
|