@ -75,7 +75,13 @@ exception Inherently_dangerous_function of Localise.error_desc
exception Internal_error of Localise . error_desc
exception Internal_error of Localise . error_desc
exception Leak of bool * ( visibility * Localise . error_desc ) * bool * PredSymb . resource * L . ocaml_pos
exception
Leak of
bool
* ( bool (* is it user visible? *) * Localise . error_desc )
* bool
* PredSymb . resource
* L . ocaml_pos
exception Missing_fld of Fieldname . t * L . ocaml_pos
exception Missing_fld of Fieldname . t * L . ocaml_pos
@ -208,12 +214,11 @@ let recognize_exception exn =
; visibility = Exn_developer
; visibility = Exn_developer
; severity = Some Info }
; severity = Some Info }
| Dangling_pointer_dereference ( user_visible , desc , ocaml_pos ) ->
| Dangling_pointer_dereference ( user_visible , desc , ocaml_pos ) ->
let visibility = if user_visible then Exn_user else Exn_developer in
let issue_type , visibility =
{ issue_type = IssueType . dangling_pointer_dereference
if user_visible then ( IssueType . dangling_pointer_dereference , Exn_user )
; description = desc
else ( IssueType . dangling_pointer_dereference_maybe , Exn_developer )
; ocaml_pos = Some ocaml_pos
in
; visibility
{ issue_type ; description = desc ; ocaml_pos = Some ocaml_pos ; visibility ; severity = None }
; severity = None }
| Deallocate_stack_variable desc ->
| Deallocate_stack_variable desc ->
{ issue_type = IssueType . deallocate_stack_variable
{ issue_type = IssueType . deallocate_stack_variable
; description = desc
; description = desc
@ -290,7 +295,7 @@ let recognize_exception exn =
; ocaml_pos = None
; ocaml_pos = None
; visibility = Exn_developer
; visibility = Exn_developer
; severity = None }
; severity = None }
| Leak ( fp_part , ( exn_vis , 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
@ -303,6 +308,12 @@ let recognize_exception exn =
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; visibility = Exn_developer
; severity = None }
; severity = None }
else if not user_visible then
{ issue_type = IssueType . leak_unknown_origin
; description = error_desc
; ocaml_pos = Some ocaml_pos
; visibility = Exn_developer
; severity = None }
else
else
let issue_type =
let issue_type =
match resource with
match resource with
@ -318,7 +329,7 @@ let recognize_exception exn =
{ issue_type
{ issue_type
; description = error_desc
; description = error_desc
; ocaml_pos = Some ocaml_pos
; ocaml_pos = Some ocaml_pos
; visibility = exn_vis
; visibility = Exn_user
; severity = None }
; severity = None }
| 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