diff --git a/infer/src/IR/Exceptions.ml b/infer/src/IR/Exceptions.ml index be242beb1..169b9eddf 100644 --- a/infer/src/IR/Exceptions.ml +++ b/infer/src/IR/Exceptions.ml @@ -130,8 +130,6 @@ exception Unary_minus_applied_to_unsigned_expression of Localise.error_desc * L. exception Unknown_proc -exception Unreachable_code_after of Localise.error_desc * L.ocaml_pos - exception Unsafe_guarded_by_access of Localise.error_desc * L.ocaml_pos exception Use_after_free of Localise.error_desc * L.ocaml_pos @@ -532,13 +530,6 @@ let recognize_exception exn = ; visibility= Exn_developer ; severity= None ; category= Nocat } - | Unreachable_code_after (desc, ocaml_pos) -> - { name= IssueType.unreachable_code_after - ; description= desc - ; ocaml_pos= Some ocaml_pos - ; visibility= Exn_user - ; severity= None - ; category= Nocat } | Unsafe_guarded_by_access (desc, ocaml_pos) -> { name= IssueType.unsafe_guarded_by_access ; description= desc diff --git a/infer/src/IR/Exceptions.mli b/infer/src/IR/Exceptions.mli index dc180bc83..6131854e9 100644 --- a/infer/src/IR/Exceptions.mli +++ b/infer/src/IR/Exceptions.mli @@ -134,8 +134,6 @@ exception Unary_minus_applied_to_unsigned_expression of Localise.error_desc * Lo exception Unknown_proc -exception Unreachable_code_after of Localise.error_desc * Logging.ocaml_pos - exception Unsafe_guarded_by_access of Localise.error_desc * Logging.ocaml_pos exception Use_after_free of Localise.error_desc * Logging.ocaml_pos diff --git a/infer/src/IR/Localise.ml b/infer/src/IR/Localise.ml index d5e451401..1cad15d5e 100644 --- a/infer/src/IR/Localise.ml +++ b/infer/src/IR/Localise.ml @@ -543,12 +543,6 @@ let desc_condition_always_true_false i cond_str_opt loc = {no_desc with descriptions= [description]; tags= !tags} -let desc_unreachable_code_after loc = - let tags = Tags.create () in - let description = "Unreachable code after statement " ^ at_line tags loc in - {no_desc with descriptions= [description]} - - let desc_deallocate_stack_variable var_str proc_name loc = let tags = Tags.create () in Tags.update tags Tags.value var_str ; diff --git a/infer/src/IR/Localise.mli b/infer/src/IR/Localise.mli index addda5e86..ee5dd8eab 100644 --- a/infer/src/IR/Localise.mli +++ b/infer/src/IR/Localise.mli @@ -119,8 +119,6 @@ val desc_class_cast_exception : val desc_condition_always_true_false : IntLit.t -> string option -> Location.t -> error_desc -val desc_unreachable_code_after : Location.t -> error_desc - val desc_deallocate_stack_variable : string -> Typ.Procname.t -> Location.t -> error_desc val desc_deallocate_static_memory : string -> Typ.Procname.t -> Location.t -> error_desc diff --git a/infer/src/backend/errdesc.ml b/infer/src/backend/errdesc.ml index a7d6e4c9d..56a4c5e2a 100644 --- a/infer/src/backend/errdesc.ml +++ b/infer/src/backend/errdesc.ml @@ -1164,8 +1164,6 @@ let explain_condition_always_true_false tenv i cond node loc = Localise.desc_condition_always_true_false i cond_str_opt loc -let explain_unreachable_code_after loc = Localise.desc_unreachable_code_after loc - (** explain the escape of a stack variable address from its scope *) let explain_stack_variable_address_escape loc pvar addr_dexp_opt = let addr_dexp_str = diff --git a/infer/src/backend/errdesc.mli b/infer/src/backend/errdesc.mli index 4d2e61032..784f248ea 100644 --- a/infer/src/backend/errdesc.mli +++ b/infer/src/backend/errdesc.mli @@ -95,8 +95,6 @@ val explain_condition_always_true_false : Tenv.t -> IntLit.t -> Exp.t -> Procdesc.Node.t -> Location.t -> Localise.error_desc (** explain a condition which is always true or false *) -val explain_unreachable_code_after : Location.t -> Localise.error_desc - val explain_stack_variable_address_escape : Location.t -> Pvar.t -> DecompiledExp.t option -> Localise.error_desc (** explain the escape of a stack variable address from its scope *) diff --git a/infer/src/bufferoverrun/bufferOverrunChecker.ml b/infer/src/bufferoverrun/bufferOverrunChecker.ml index 8db113ee7..08d6bea51 100644 --- a/infer/src/bufferoverrun/bufferOverrunChecker.ml +++ b/infer/src/bufferoverrun/bufferOverrunChecker.ml @@ -432,8 +432,11 @@ module Report = struct () | _ -> let location = Sil.instr_get_loc instr in - let desc = Errdesc.explain_unreachable_code_after location in - let exn = Exceptions.Unreachable_code_after (desc, __POS__) in + let exn = + Exceptions.Checkers + ( IssueType.unreachable_code_after + , Localise.verbatim_desc "Unreachable code after statement" ) + in Reporting.log_error summary ~loc:location exn