@ -23,21 +23,15 @@ let string_of_visibility vis =
match vis with Exn_user -> " user " | Exn_developer -> " developer " | Exn_system -> " system "
match vis with Exn_user -> " user " | Exn_developer -> " developer " | Exn_system -> " system "
(* * severity of bugs *)
type severity =
| High (* * high severity bug *)
| Medium (* * medium severity bug *)
| Low (* * low severity bug *)
(* * class of error/warning *)
(* * class of error/warning *)
type err_class = Checker | Prover | Nocat | Linters [ @@ deriving compare ]
type err_class = Checker | Prover | Nocat | Linters [ @@ deriving compare ]
let equal_err_class = [ % compare . equal : err_class ]
let equal_err_class = [ % compare . equal : err_class ]
(* * kind of error/warning *)
(* * severity of the report *)
type err_kind = Kwarning | Kerror | Kinfo | Kadvice | Klike [ @@ deriving compare ]
type severity = Kwarning | Kerror | Kinfo | Kadvice | Klike [ @@ deriving compare ]
let equal_ err_kind = [ % compare . equal : err_kind ]
let equal_ severity = [ % compare . equal : severity ]
exception Abduction_case_not_implemented of L . ocaml_pos
exception Abduction_case_not_implemented of L . ocaml_pos
@ -151,8 +145,7 @@ type 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 *)
; visibility : visibility
; visibility : visibility
; severity : severity
; severity : severity option
; kind : err_kind option
; category : err_class }
; category : err_class }
let recognize_exception exn =
let recognize_exception exn =
@ -163,8 +156,7 @@ let recognize_exception exn =
; description = Localise . no_desc
; description = Localise . no_desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Low
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Analysis_stops ( desc , ocaml_pos_opt ) ->
| Analysis_stops ( desc , ocaml_pos_opt ) ->
let visibility = if Config . analysis_stops then Exn_user else Exn_developer in
let visibility = if Config . analysis_stops then Exn_user else Exn_developer in
@ -172,40 +164,35 @@ let recognize_exception exn =
; description = desc
; description = desc
; ocaml_pos = ocaml_pos_opt
; ocaml_pos = ocaml_pos_opt
; visibility
; visibility
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Array_of_pointsto ocaml_pos ->
| Array_of_pointsto ocaml_pos ->
{ name = IssueType . array_of_pointsto
{ name = IssueType . array_of_pointsto
; description = Localise . no_desc
; description = Localise . no_desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Low
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Array_out_of_bounds_l1 ( desc , ocaml_pos ) ->
| Array_out_of_bounds_l1 ( desc , ocaml_pos ) ->
{ name = IssueType . array_out_of_bounds_l1
{ name = IssueType . array_out_of_bounds_l1
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = High
; severity = Some Kerror
; kind = Some Kerror
; category = Checker }
; category = Checker }
| Array_out_of_bounds_l2 ( desc , ocaml_pos ) ->
| Array_out_of_bounds_l2 ( desc , ocaml_pos ) ->
{ name = IssueType . array_out_of_bounds_l2
{ name = IssueType . array_out_of_bounds_l2
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Array_out_of_bounds_l3 ( desc , ocaml_pos ) ->
| Array_out_of_bounds_l3 ( desc , ocaml_pos ) ->
{ name = IssueType . array_out_of_bounds_l3
{ name = IssueType . array_out_of_bounds_l3
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| 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
@ -213,48 +200,42 @@ let recognize_exception exn =
; description = Localise . no_desc
; description = Localise . no_desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = High
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Bad_footprint ocaml_pos ->
| Bad_footprint ocaml_pos ->
{ name = IssueType . bad_footprint
{ name = IssueType . bad_footprint
; description = Localise . no_desc
; description = Localise . no_desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Low
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Cannot_star ocaml_pos ->
| Cannot_star ocaml_pos ->
{ name = IssueType . cannot_star
{ name = IssueType . cannot_star
; description = Localise . no_desc
; description = Localise . no_desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Low
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Class_cast_exception ( desc , ocaml_pos ) ->
| Class_cast_exception ( desc , ocaml_pos ) ->
{ name = IssueType . class_cast_exception
{ name = IssueType . class_cast_exception
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Codequery desc ->
| Codequery desc ->
{ name = IssueType . codequery
{ name = IssueType . codequery
; description = desc
; description = desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Comparing_floats_for_equality ( desc , ocaml_pos ) ->
| Comparing_floats_for_equality ( desc , ocaml_pos ) ->
{ name = IssueType . comparing_floats_for_equality
{ name = IssueType . comparing_floats_for_equality
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Condition_always_true_false ( desc , b , ocaml_pos ) ->
| Condition_always_true_false ( desc , b , ocaml_pos ) ->
let name = if b then IssueType . condition_always_true else IssueType . condition_always_false in
let name = if b then IssueType . condition_always_true else IssueType . condition_always_false in
@ -262,24 +243,21 @@ let recognize_exception exn =
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Custom_error ( error_msg , desc ) ->
| Custom_error ( error_msg , desc ) ->
{ name = IssueType . from_string error_msg
{ name = IssueType . from_string error_msg
; description = desc
; description = desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Checker }
; category = Checker }
| Dummy_exception desc ->
| Dummy_exception desc ->
{ name = IssueType . from_string " Analysis stops "
{ name = IssueType . from_string " Analysis stops "
; description = desc
; description = desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Low
; severity = Some Kinfo
; kind = Some Kinfo
; category = Checker }
; category = Checker }
| Dangling_pointer_dereference ( dko , desc , ocaml_pos ) ->
| Dangling_pointer_dereference ( dko , desc , ocaml_pos ) ->
let visibility =
let visibility =
@ -293,128 +271,112 @@ let recognize_exception exn =
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility
; visibility
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Deallocate_stack_variable desc ->
| Deallocate_stack_variable desc ->
{ name = IssueType . deallocate_stack_variable
{ name = IssueType . deallocate_stack_variable
; description = desc
; description = desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Deallocate_static_memory desc ->
| Deallocate_static_memory desc ->
{ name = IssueType . deallocate_static_memory
{ name = IssueType . deallocate_static_memory
; description = desc
; description = desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Deallocation_mismatch ( desc , ocaml_pos ) ->
| Deallocation_mismatch ( desc , ocaml_pos ) ->
{ name = IssueType . deallocation_mismatch
{ name = IssueType . deallocation_mismatch
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Divide_by_zero ( desc , ocaml_pos ) ->
| Divide_by_zero ( desc , ocaml_pos ) ->
{ name = IssueType . divide_by_zero
{ name = IssueType . divide_by_zero
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = Some Kerror
; kind = Some Kerror
; category = Checker }
; category = Checker }
| Double_lock ( desc , ocaml_pos ) ->
| Double_lock ( desc , ocaml_pos ) ->
{ name = IssueType . double_lock
{ name = IssueType . double_lock
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = Some Kerror
; kind = Some Kerror
; category = Prover }
; category = Prover }
| Eradicate ( kind , desc ) ->
| Eradicate ( kind , desc ) ->
{ name = kind
{ name = kind
; description = desc
; description = desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Empty_vector_access ( desc , ocaml_pos ) ->
| Empty_vector_access ( desc , ocaml_pos ) ->
{ name = IssueType . empty_vector_access
{ name = IssueType . empty_vector_access
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = Some Kerror
; kind = Some Kerror
; category = Prover }
; category = Prover }
| Field_not_null_checked ( desc , ocaml_pos ) ->
| Field_not_null_checked ( desc , ocaml_pos ) ->
{ name = IssueType . field_not_null_checked
{ name = IssueType . field_not_null_checked
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = Medium
; severity = Some Kwarning
; kind = Some Kwarning
; category = Nocat }
; category = Nocat }
| Frontend_warning ( ( name , hum ) , desc , ocaml_pos ) ->
| Frontend_warning ( ( name , hum ) , desc , ocaml_pos ) ->
{ name = IssueType . from_string name ? hum
{ name = IssueType . from_string name ? hum
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = Medium
; severity = None
; kind = None
; category = Linters }
; category = Linters }
| Checkers ( kind , desc ) ->
| Checkers ( kind , desc ) ->
{ name = kind
{ name = kind
; description = desc
; description = desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Null_dereference ( desc , ocaml_pos ) ->
| Null_dereference ( desc , ocaml_pos ) ->
{ name = IssueType . null_dereference
{ name = IssueType . null_dereference
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Null_test_after_dereference ( desc , ocaml_pos ) ->
| Null_test_after_dereference ( desc , ocaml_pos ) ->
{ name = IssueType . null_test_after_dereference
{ name = IssueType . null_test_after_dereference
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Pointer_size_mismatch ( desc , ocaml_pos ) ->
| Pointer_size_mismatch ( desc , ocaml_pos ) ->
{ name = IssueType . pointer_size_mismatch
{ name = IssueType . pointer_size_mismatch
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = Some Kerror
; kind = Some Kerror
; category = Checker }
; category = Checker }
| Inherently_dangerous_function desc ->
| Inherently_dangerous_function desc ->
{ name = IssueType . inherently_dangerous_function
{ name = IssueType . inherently_dangerous_function
; description = desc
; description = desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Internal_error desc ->
| Internal_error desc ->
{ name = IssueType . internal_error
{ name = IssueType . internal_error
; description = desc
; description = desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_developer
; visibility = Exn_developer
; severity = High
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Java_runtime_exception ( exn_name , _ , desc ) ->
| Java_runtime_exception ( exn_name , _ , desc ) ->
let exn_str = Typ . Name . name exn_name in
let exn_str = Typ . Name . name exn_name in
@ -422,8 +384,7 @@ let recognize_exception exn =
; description = desc
; description = desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Leak ( fp_part , _ , ( exn_vis , error_desc ) , done_array_abstraction , resource , ocaml_pos ) ->
| Leak ( fp_part , _ , ( exn_vis , error_desc ) , done_array_abstraction , resource , ocaml_pos ) ->
if done_array_abstraction then
if done_array_abstraction then
@ -431,16 +392,14 @@ let recognize_exception exn =
; description = error_desc
; description = error_desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
else if fp_part then
else if fp_part then
{ name = IssueType . leak_in_footprint
{ name = IssueType . leak_in_footprint
; description = error_desc
; description = error_desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
else
else
let name =
let name =
@ -458,8 +417,7 @@ let recognize_exception exn =
; description = error_desc
; description = error_desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = exn_vis
; visibility = exn_vis
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Missing_fld ( fld , ocaml_pos ) ->
| Missing_fld ( fld , ocaml_pos ) ->
let desc = Localise . verbatim_desc ( Typ . Fieldname . to_full_string fld ) in
let desc = Localise . verbatim_desc ( Typ . Fieldname . to_full_string fld ) in
@ -467,40 +425,35 @@ let recognize_exception exn =
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Premature_nil_termination ( desc , ocaml_pos ) ->
| Premature_nil_termination ( desc , ocaml_pos ) ->
{ name = IssueType . premature_nil_termination
{ name = IssueType . premature_nil_termination
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Parameter_not_null_checked ( desc , ocaml_pos ) ->
| Parameter_not_null_checked ( desc , ocaml_pos ) ->
{ name = IssueType . parameter_not_null_checked
{ name = IssueType . parameter_not_null_checked
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = Medium
; severity = Some Kwarning
; kind = Some Kwarning
; category = Nocat }
; category = Nocat }
| Precondition_not_found ( desc , ocaml_pos ) ->
| Precondition_not_found ( desc , ocaml_pos ) ->
{ name = IssueType . precondition_not_found
{ name = IssueType . precondition_not_found
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Low
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Precondition_not_met ( desc , ocaml_pos ) ->
| Precondition_not_met ( desc , ocaml_pos ) ->
{ name = IssueType . precondition_not_met
{ name = IssueType . precondition_not_met
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Medium
; severity = Some Kwarning
; kind = Some Kwarning
; category = Nocat }
; category = Nocat }
(* always a warning *)
(* always a warning *)
| Retain_cycle ( desc , ocaml_pos ) ->
| Retain_cycle ( desc , ocaml_pos ) ->
@ -508,72 +461,63 @@ let recognize_exception exn =
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Registered_observer_being_deallocated ( desc , ocaml_pos ) ->
| Registered_observer_being_deallocated ( desc , ocaml_pos ) ->
{ name = IssueType . registered_observer_being_deallocated
{ name = IssueType . registered_observer_being_deallocated
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = Some Kerror
; kind = Some Kerror
; category = Nocat }
; category = Nocat }
| Return_expression_required ( desc , ocaml_pos ) ->
| Return_expression_required ( desc , ocaml_pos ) ->
{ name = IssueType . return_expression_required
{ name = IssueType . return_expression_required
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Stack_variable_address_escape ( desc , ocaml_pos ) ->
| Stack_variable_address_escape ( desc , ocaml_pos ) ->
{ name = IssueType . stack_variable_address_escape
{ name = IssueType . stack_variable_address_escape
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = Some Kerror
; kind = Some Kerror
; category = Nocat }
; category = Nocat }
| Return_statement_missing ( desc , ocaml_pos ) ->
| Return_statement_missing ( desc , ocaml_pos ) ->
{ name = IssueType . return_statement_missing
{ name = IssueType . return_statement_missing
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Return_value_ignored ( desc , ocaml_pos ) ->
| Return_value_ignored ( desc , ocaml_pos ) ->
{ name = IssueType . return_value_ignored
{ name = IssueType . return_value_ignored
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| SymOp . Analysis_failure_exe _ ->
| SymOp . Analysis_failure_exe _ ->
{ name = IssueType . failure_exe
{ name = IssueType . failure_exe
; description = Localise . no_desc
; description = Localise . no_desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_system
; visibility = Exn_system
; severity = Low
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Skip_function desc ->
| Skip_function desc ->
{ name = IssueType . skip_function
{ name = IssueType . skip_function
; description = desc
; description = desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Low
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Skip_pointer_dereference ( desc , ocaml_pos ) ->
| Skip_pointer_dereference ( desc , ocaml_pos ) ->
{ name = IssueType . skip_pointer_dereference
{ name = IssueType . skip_pointer_dereference
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = Medium
; severity = Some Kinfo
; kind = Some Kinfo
; category = Nocat }
; category = Nocat }
(* always an info *)
(* always an info *)
| Symexec_memory_error ocaml_pos ->
| Symexec_memory_error ocaml_pos ->
@ -581,56 +525,49 @@ let recognize_exception exn =
; description = Localise . no_desc
; description = Localise . no_desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Low
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Unary_minus_applied_to_unsigned_expression ( desc , ocaml_pos ) ->
| Unary_minus_applied_to_unsigned_expression ( desc , ocaml_pos ) ->
{ name = IssueType . unary_minus_applied_to_unsigned_expression
{ name = IssueType . unary_minus_applied_to_unsigned_expression
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Unknown_proc ->
| Unknown_proc ->
{ name = IssueType . unknown_proc
{ name = IssueType . unknown_proc
; description = Localise . no_desc
; description = Localise . no_desc
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Low
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Unreachable_code_after ( desc , ocaml_pos ) ->
| Unreachable_code_after ( desc , ocaml_pos ) ->
{ name = IssueType . unreachable_code_after
{ name = IssueType . unreachable_code_after
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = Medium
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| Unsafe_guarded_by_access ( desc , ocaml_pos ) ->
| Unsafe_guarded_by_access ( desc , ocaml_pos ) ->
{ name = IssueType . unsafe_guarded_by_access
{ name = IssueType . unsafe_guarded_by_access
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Use_after_free ( desc , ocaml_pos ) ->
| Use_after_free ( desc , ocaml_pos ) ->
{ name = IssueType . use_after_free
{ name = IssueType . use_after_free
; description = desc
; description = desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_user
; visibility = Exn_user
; severity = High
; severity = None
; kind = None
; category = Prover }
; category = Prover }
| Wrong_argument_number ocaml_pos ->
| Wrong_argument_number ocaml_pos ->
{ name = IssueType . wrong_argument_number
{ name = IssueType . wrong_argument_number
; description = Localise . no_desc
; description = Localise . no_desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Low
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
| exn ->
| exn ->
{ name = IssueType . failure_exe
{ name = IssueType . failure_exe
@ -638,8 +575,7 @@ let recognize_exception exn =
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
; visibility = Exn_system
; visibility = Exn_system
; severity = Low
; severity = None
; kind = None
; category = Nocat }
; category = Nocat }
@ -659,7 +595,7 @@ let print_exception_html s exn =
(* * string describing an error kind *)
(* * string describing an error kind *)
let err_kind _string = function
let severity _string = function
| Kwarning ->
| Kwarning ->
" WARNING "
" WARNING "
| Kerror ->
| Kerror ->
@ -688,8 +624,8 @@ let err_class_string = function
let print_key = false
let print_key = false
(* * pretty print an error *)
(* * pretty print an error *)
let pp_err ~ node_key loc ekind ex_name desc ocaml_pos_opt fmt () =
let pp_err ~ node_key loc severity ex_name desc ocaml_pos_opt fmt () =
let kind = err_kind_string ( if equal_err_kind ekind Kinfo then Kwarning else ekind ) in
let kind = severity_string ( if equal_severity severity Kinfo then Kwarning else severity ) in
let pp_key fmt k = if print_key then F . fprintf fmt " key: %s " ( Caml . Digest . to_hex k ) else () in
let pp_key fmt k = if print_key then F . fprintf fmt " key: %s " ( Caml . Digest . to_hex k ) else () in
F . fprintf fmt " %a:%d: %s: %a %a%a%a@ \n " SourceFile . pp loc . Location . file loc . Location . line kind
F . fprintf fmt " %a:%d: %s: %a %a%a%a@ \n " SourceFile . pp loc . Location . file loc . Location . line kind
IssueType . pp ex_name Localise . pp_error_desc desc pp_key node_key L . pp_ocaml_pos_opt
IssueType . pp ex_name Localise . pp_error_desc desc pp_key node_key L . pp_ocaml_pos_opt