[IR] delete unused Issue types

Summary:
`ocamlc` didn't tell us but there are a bunch of dead exceptions in
`Exceptions.ml` that translate into dead issue types.

Found with:

```
for ex in $(grep -o -e '^exception [^ ]*' infer/src/IR/Exceptions.mli | cut -d ' ' -f 2); do git grep -q -e '\braise .*'$ex || git grep -q -e 'Exceptions\.'$ex || echo $ex; done
```

Reviewed By: skcho

Differential Revision: D21618645

fbshipit-source-id: f60a3f445
master
Jules Villard 5 years ago committed by Facebook GitHub Bot
parent a5203ced4e
commit 090ce4edb9

@ -375,7 +375,6 @@ OPTIONS
CHECKERS_PRINTF_ARGS (enabled by default), CHECKERS_PRINTF_ARGS (enabled by default),
CLASS_CAST_EXCEPTION (disabled by default), CLASS_CAST_EXCEPTION (disabled by default),
CLASS_LOAD (enabled by default), CLASS_LOAD (enabled by default),
COMPARING_FLOAT_FOR_EQUALITY (enabled by default),
COMPONENT_FACTORY_FUNCTION (enabled by default), COMPONENT_FACTORY_FUNCTION (enabled by default),
COMPONENT_FILE_CYCLOMATIC_COMPLEXITY (enabled by default), COMPONENT_FILE_CYCLOMATIC_COMPLEXITY (enabled by default),
COMPONENT_FILE_LINE_COUNT (disabled by default), COMPONENT_FILE_LINE_COUNT (disabled by default),
@ -388,7 +387,6 @@ OPTIONS
CREATE_INTENT_FROM_URI (enabled by default), CREATE_INTENT_FROM_URI (enabled by default),
CROSS_SITE_SCRIPTING (enabled by default), CROSS_SITE_SCRIPTING (enabled by default),
Cannot_star (enabled by default), Cannot_star (enabled by default),
Codequery (enabled by default),
DANGLING_POINTER_DEREFERENCE (disabled by default), DANGLING_POINTER_DEREFERENCE (disabled by default),
DEADLOCK (enabled by default), DEADLOCK (enabled by default),
DEAD_STORE (enabled by default), DEAD_STORE (enabled by default),
@ -478,9 +476,6 @@ OPTIONS
REGISTERED_OBSERVER_BEING_DEALLOCATED (enabled by default), REGISTERED_OBSERVER_BEING_DEALLOCATED (enabled by default),
RESOURCE_LEAK (enabled by default), RESOURCE_LEAK (enabled by default),
RETAIN_CYCLE (enabled by default), RETAIN_CYCLE (enabled by default),
RETURN_EXPRESSION_REQUIRED (enabled by default),
RETURN_STATEMENT_MISSING (enabled by default),
RETURN_VALUE_IGNORED (disabled by default),
SHELL_INJECTION (enabled by default), SHELL_INJECTION (enabled by default),
SHELL_INJECTION_RISK (enabled by default), SHELL_INJECTION_RISK (enabled by default),
SKIP_FUNCTION (disabled by default), SKIP_FUNCTION (disabled by default),
@ -513,7 +508,6 @@ OPTIONS
USE_AFTER_DELETE (enabled by default), USE_AFTER_DELETE (enabled by default),
USE_AFTER_FREE (enabled by default), USE_AFTER_FREE (enabled by default),
USE_AFTER_LIFETIME (enabled by default), USE_AFTER_LIFETIME (enabled by default),
Unknown_proc (enabled by default),
VECTOR_INVALIDATION (enabled by default), VECTOR_INVALIDATION (enabled by default),
WEAK_SELF_IN_NO_ESCAPE_BLOCK (enabled by default), WEAK_SELF_IN_NO_ESCAPE_BLOCK (enabled by default),
Wrong_argument_number (enabled by default). Wrong_argument_number (enabled by default).

@ -105,7 +105,6 @@ OPTIONS
CHECKERS_PRINTF_ARGS (enabled by default), CHECKERS_PRINTF_ARGS (enabled by default),
CLASS_CAST_EXCEPTION (disabled by default), CLASS_CAST_EXCEPTION (disabled by default),
CLASS_LOAD (enabled by default), CLASS_LOAD (enabled by default),
COMPARING_FLOAT_FOR_EQUALITY (enabled by default),
COMPONENT_FACTORY_FUNCTION (enabled by default), COMPONENT_FACTORY_FUNCTION (enabled by default),
COMPONENT_FILE_CYCLOMATIC_COMPLEXITY (enabled by default), COMPONENT_FILE_CYCLOMATIC_COMPLEXITY (enabled by default),
COMPONENT_FILE_LINE_COUNT (disabled by default), COMPONENT_FILE_LINE_COUNT (disabled by default),
@ -118,7 +117,6 @@ OPTIONS
CREATE_INTENT_FROM_URI (enabled by default), CREATE_INTENT_FROM_URI (enabled by default),
CROSS_SITE_SCRIPTING (enabled by default), CROSS_SITE_SCRIPTING (enabled by default),
Cannot_star (enabled by default), Cannot_star (enabled by default),
Codequery (enabled by default),
DANGLING_POINTER_DEREFERENCE (disabled by default), DANGLING_POINTER_DEREFERENCE (disabled by default),
DEADLOCK (enabled by default), DEADLOCK (enabled by default),
DEAD_STORE (enabled by default), DEAD_STORE (enabled by default),
@ -208,9 +206,6 @@ OPTIONS
REGISTERED_OBSERVER_BEING_DEALLOCATED (enabled by default), REGISTERED_OBSERVER_BEING_DEALLOCATED (enabled by default),
RESOURCE_LEAK (enabled by default), RESOURCE_LEAK (enabled by default),
RETAIN_CYCLE (enabled by default), RETAIN_CYCLE (enabled by default),
RETURN_EXPRESSION_REQUIRED (enabled by default),
RETURN_STATEMENT_MISSING (enabled by default),
RETURN_VALUE_IGNORED (disabled by default),
SHELL_INJECTION (enabled by default), SHELL_INJECTION (enabled by default),
SHELL_INJECTION_RISK (enabled by default), SHELL_INJECTION_RISK (enabled by default),
SKIP_FUNCTION (disabled by default), SKIP_FUNCTION (disabled by default),
@ -243,7 +238,6 @@ OPTIONS
USE_AFTER_DELETE (enabled by default), USE_AFTER_DELETE (enabled by default),
USE_AFTER_FREE (enabled by default), USE_AFTER_FREE (enabled by default),
USE_AFTER_LIFETIME (enabled by default), USE_AFTER_LIFETIME (enabled by default),
Unknown_proc (enabled by default),
VECTOR_INVALIDATION (enabled by default), VECTOR_INVALIDATION (enabled by default),
WEAK_SELF_IN_NO_ESCAPE_BLOCK (enabled by default), WEAK_SELF_IN_NO_ESCAPE_BLOCK (enabled by default),
Wrong_argument_number (enabled by default). Wrong_argument_number (enabled by default).

@ -375,7 +375,6 @@ OPTIONS
CHECKERS_PRINTF_ARGS (enabled by default), CHECKERS_PRINTF_ARGS (enabled by default),
CLASS_CAST_EXCEPTION (disabled by default), CLASS_CAST_EXCEPTION (disabled by default),
CLASS_LOAD (enabled by default), CLASS_LOAD (enabled by default),
COMPARING_FLOAT_FOR_EQUALITY (enabled by default),
COMPONENT_FACTORY_FUNCTION (enabled by default), COMPONENT_FACTORY_FUNCTION (enabled by default),
COMPONENT_FILE_CYCLOMATIC_COMPLEXITY (enabled by default), COMPONENT_FILE_CYCLOMATIC_COMPLEXITY (enabled by default),
COMPONENT_FILE_LINE_COUNT (disabled by default), COMPONENT_FILE_LINE_COUNT (disabled by default),
@ -388,7 +387,6 @@ OPTIONS
CREATE_INTENT_FROM_URI (enabled by default), CREATE_INTENT_FROM_URI (enabled by default),
CROSS_SITE_SCRIPTING (enabled by default), CROSS_SITE_SCRIPTING (enabled by default),
Cannot_star (enabled by default), Cannot_star (enabled by default),
Codequery (enabled by default),
DANGLING_POINTER_DEREFERENCE (disabled by default), DANGLING_POINTER_DEREFERENCE (disabled by default),
DEADLOCK (enabled by default), DEADLOCK (enabled by default),
DEAD_STORE (enabled by default), DEAD_STORE (enabled by default),
@ -478,9 +476,6 @@ OPTIONS
REGISTERED_OBSERVER_BEING_DEALLOCATED (enabled by default), REGISTERED_OBSERVER_BEING_DEALLOCATED (enabled by default),
RESOURCE_LEAK (enabled by default), RESOURCE_LEAK (enabled by default),
RETAIN_CYCLE (enabled by default), RETAIN_CYCLE (enabled by default),
RETURN_EXPRESSION_REQUIRED (enabled by default),
RETURN_STATEMENT_MISSING (enabled by default),
RETURN_VALUE_IGNORED (disabled by default),
SHELL_INJECTION (enabled by default), SHELL_INJECTION (enabled by default),
SHELL_INJECTION_RISK (enabled by default), SHELL_INJECTION_RISK (enabled by default),
SKIP_FUNCTION (disabled by default), SKIP_FUNCTION (disabled by default),
@ -513,7 +508,6 @@ OPTIONS
USE_AFTER_DELETE (enabled by default), USE_AFTER_DELETE (enabled by default),
USE_AFTER_FREE (enabled by default), USE_AFTER_FREE (enabled by default),
USE_AFTER_LIFETIME (enabled by default), USE_AFTER_LIFETIME (enabled by default),
Unknown_proc (enabled by default),
VECTOR_INVALIDATION (enabled by default), VECTOR_INVALIDATION (enabled by default),
WEAK_SELF_IN_NO_ESCAPE_BLOCK (enabled by default), WEAK_SELF_IN_NO_ESCAPE_BLOCK (enabled by default),
Wrong_argument_number (enabled by default). Wrong_argument_number (enabled by default).

@ -49,10 +49,6 @@ exception Cannot_star of L.ocaml_pos
exception Class_cast_exception of Localise.error_desc * L.ocaml_pos exception Class_cast_exception of Localise.error_desc * L.ocaml_pos
exception Codequery of Localise.error_desc
exception Comparing_floats_for_equality of Localise.error_desc * L.ocaml_pos
exception Condition_always_true_false of Localise.error_desc * bool * L.ocaml_pos exception Condition_always_true_false of Localise.error_desc * bool * L.ocaml_pos
exception Custom_error of string * Localise.error_desc exception Custom_error of string * Localise.error_desc
@ -84,8 +80,6 @@ exception Inherently_dangerous_function of Localise.error_desc
exception Internal_error of Localise.error_desc exception Internal_error of Localise.error_desc
exception Java_runtime_exception of Typ.Name.t * string * Localise.error_desc
exception Leak of bool * (visibility * Localise.error_desc) * bool * PredSymb.resource * L.ocaml_pos exception Leak of bool * (visibility * 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
@ -108,12 +102,6 @@ exception Retain_cycle of Localise.error_desc * L.ocaml_pos
exception Registered_observer_being_deallocated of Localise.error_desc * L.ocaml_pos exception Registered_observer_being_deallocated of Localise.error_desc * L.ocaml_pos
exception Return_expression_required of Localise.error_desc * L.ocaml_pos
exception Return_statement_missing of Localise.error_desc * L.ocaml_pos
exception Return_value_ignored of Localise.error_desc * L.ocaml_pos
exception Skip_function of Localise.error_desc exception Skip_function of Localise.error_desc
exception Skip_pointer_dereference of Localise.error_desc * L.ocaml_pos exception Skip_pointer_dereference of Localise.error_desc * L.ocaml_pos
@ -124,8 +112,6 @@ exception Symexec_memory_error of L.ocaml_pos
exception Unary_minus_applied_to_unsigned_expression of Localise.error_desc * L.ocaml_pos exception Unary_minus_applied_to_unsigned_expression of Localise.error_desc * L.ocaml_pos
exception Unknown_proc
exception Wrong_argument_number of L.ocaml_pos exception Wrong_argument_number of L.ocaml_pos
type t = type t =
@ -218,20 +204,6 @@ let recognize_exception exn =
; visibility= Exn_developer ; visibility= Exn_developer
; severity= None ; severity= None
; category= Prover } ; category= Prover }
| Codequery desc ->
{ name= IssueType.codequery
; description= desc
; ocaml_pos= None
; visibility= Exn_user
; severity= None
; category= Prover }
| Comparing_floats_for_equality (desc, ocaml_pos) ->
{ name= IssueType.comparing_floats_for_equality
; description= desc
; ocaml_pos= Some ocaml_pos
; visibility= Exn_user
; severity= None
; 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
{ name { name
@ -360,14 +332,6 @@ let recognize_exception exn =
; visibility= Exn_developer ; visibility= Exn_developer
; severity= None ; severity= None
; category= Nocat } ; category= Nocat }
| Java_runtime_exception (exn_name, _, desc) ->
let exn_str = Typ.Name.name exn_name in
{ name= IssueType.register_from_string ~id:exn_str [Biabduction]
; description= desc
; ocaml_pos= None
; visibility= Exn_user
; severity= None
; 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
{ name= IssueType.leak_after_array_abstraction { name= IssueType.leak_after_array_abstraction
@ -452,13 +416,6 @@ let recognize_exception exn =
; visibility= Exn_user ; visibility= Exn_user
; severity= Some Error ; severity= Some Error
; category= Nocat } ; category= Nocat }
| Return_expression_required (desc, ocaml_pos) ->
{ name= IssueType.return_expression_required
; description= desc
; ocaml_pos= Some ocaml_pos
; visibility= Exn_user
; severity= None
; 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
@ -466,20 +423,6 @@ let recognize_exception exn =
; visibility= Exn_user ; visibility= Exn_user
; severity= Some Error ; severity= Some Error
; category= Nocat } ; category= Nocat }
| Return_statement_missing (desc, ocaml_pos) ->
{ name= IssueType.return_statement_missing
; description= desc
; ocaml_pos= Some ocaml_pos
; visibility= Exn_user
; severity= None
; category= Nocat }
| Return_value_ignored (desc, ocaml_pos) ->
{ name= IssueType.return_value_ignored
; description= desc
; ocaml_pos= Some ocaml_pos
; visibility= Exn_user
; severity= None
; 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
@ -516,13 +459,6 @@ let recognize_exception exn =
; visibility= Exn_user ; visibility= Exn_user
; severity= None ; severity= None
; category= Nocat } ; category= Nocat }
| Unknown_proc ->
{ name= IssueType.unknown_proc
; description= Localise.no_desc
; ocaml_pos= None
; visibility= Exn_developer
; severity= None
; category= Nocat }
| 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

@ -49,10 +49,6 @@ exception Cannot_star of Logging.ocaml_pos
exception Class_cast_exception of Localise.error_desc * Logging.ocaml_pos exception Class_cast_exception of Localise.error_desc * Logging.ocaml_pos
exception Codequery of Localise.error_desc
exception Comparing_floats_for_equality of Localise.error_desc * Logging.ocaml_pos
exception Condition_always_true_false of Localise.error_desc * bool * Logging.ocaml_pos exception Condition_always_true_false of Localise.error_desc * bool * Logging.ocaml_pos
exception Custom_error of string * Localise.error_desc exception Custom_error of string * Localise.error_desc
@ -85,8 +81,6 @@ exception Inherently_dangerous_function of Localise.error_desc
exception Internal_error of Localise.error_desc exception Internal_error of Localise.error_desc
exception Java_runtime_exception of Typ.Name.t * string * Localise.error_desc
exception exception
Leak of bool * (visibility * Localise.error_desc) * bool * PredSymb.resource * Logging.ocaml_pos Leak of bool * (visibility * Localise.error_desc) * bool * PredSymb.resource * Logging.ocaml_pos
@ -110,12 +104,6 @@ exception Retain_cycle of Localise.error_desc * Logging.ocaml_pos
exception Registered_observer_being_deallocated of Localise.error_desc * Logging.ocaml_pos exception Registered_observer_being_deallocated of Localise.error_desc * Logging.ocaml_pos
exception Return_expression_required of Localise.error_desc * Logging.ocaml_pos
exception Return_statement_missing of Localise.error_desc * Logging.ocaml_pos
exception Return_value_ignored of Localise.error_desc * Logging.ocaml_pos
exception Skip_function of Localise.error_desc exception Skip_function of Localise.error_desc
exception Skip_pointer_dereference of Localise.error_desc * Logging.ocaml_pos exception Skip_pointer_dereference of Localise.error_desc * Logging.ocaml_pos
@ -126,8 +114,6 @@ exception Symexec_memory_error of Logging.ocaml_pos
exception Unary_minus_applied_to_unsigned_expression of Localise.error_desc * Logging.ocaml_pos exception Unary_minus_applied_to_unsigned_expression of Localise.error_desc * Logging.ocaml_pos
exception Unknown_proc
exception Wrong_argument_number of Logging.ocaml_pos exception Wrong_argument_number of Logging.ocaml_pos
val severity_string : severity -> string val severity_string : severity -> string

@ -196,12 +196,6 @@ let class_cast_exception =
let class_load = register_from_string ~id:"CLASS_LOAD" [ClassLoads] let class_load = register_from_string ~id:"CLASS_LOAD" [ClassLoads]
let codequery = register_from_string ~id:"Codequery" [Biabduction]
let comparing_floats_for_equality =
register_from_string ~id:"COMPARING_FLOAT_FOR_EQUALITY" [Biabduction]
let component_factory_function = register_from_string ~id:"COMPONENT_FACTORY_FUNCTION" [Linters] let component_factory_function = register_from_string ~id:"COMPONENT_FACTORY_FUNCTION" [Linters]
let component_file_cyclomatic_complexity = let component_file_cyclomatic_complexity =
@ -499,14 +493,6 @@ let resource_leak = register_from_string ~id:"RESOURCE_LEAK" [Biabduction; Resou
let retain_cycle = register_from_string ~enabled:true ~id:"RETAIN_CYCLE" [Biabduction] let retain_cycle = register_from_string ~enabled:true ~id:"RETAIN_CYCLE" [Biabduction]
let return_expression_required = register_from_string ~id:"RETURN_EXPRESSION_REQUIRED" [Biabduction]
let return_statement_missing = register_from_string ~id:"RETURN_STATEMENT_MISSING" [Biabduction]
let return_value_ignored =
register_from_string ~enabled:false ~id:"RETURN_VALUE_IGNORED" [Biabduction]
let skip_function = register_from_string ~enabled:false ~id:"SKIP_FUNCTION" [Biabduction] let skip_function = register_from_string ~enabled:false ~id:"SKIP_FUNCTION" [Biabduction]
let skip_pointer_dereference = let skip_pointer_dereference =
@ -558,8 +544,6 @@ let unary_minus_applied_to_unsigned_expression =
let uninitialized_value = register_from_string ~id:"UNINITIALIZED_VALUE" [Uninit] let uninitialized_value = register_from_string ~id:"UNINITIALIZED_VALUE" [Uninit]
let unknown_proc = register_from_string ~id:"Unknown_proc" ~hum:"Unknown Procedure" [Biabduction]
let unreachable_code_after = register_from_string ~id:"UNREACHABLE_CODE" [BufferOverrun] let unreachable_code_after = register_from_string ~id:"UNREACHABLE_CODE" [BufferOverrun]
let use_after_delete = register_from_string ~id:"USE_AFTER_DELETE" [Pulse] let use_after_delete = register_from_string ~id:"USE_AFTER_DELETE" [Pulse]

@ -111,10 +111,6 @@ val class_cast_exception : t
val class_load : t val class_load : t
val codequery : t
val comparing_floats_for_equality : t
val complexity_increase : kind:CostKind.t -> is_on_ui_thread:bool -> t val complexity_increase : kind:CostKind.t -> is_on_ui_thread:bool -> t
val component_factory_function : t val component_factory_function : t
@ -294,12 +290,6 @@ val resource_leak : t
val retain_cycle : t val retain_cycle : t
val return_expression_required : t
val return_statement_missing : t
val return_value_ignored : t
val skip_function : t val skip_function : t
val skip_pointer_dereference : t val skip_pointer_dereference : t
@ -332,8 +322,6 @@ val unary_minus_applied_to_unsigned_expression : t
val uninitialized_value : t val uninitialized_value : t
val unknown_proc : t
val unreachable_code_after : t val unreachable_code_after : t
val use_after_delete : t val use_after_delete : t

Loading…
Cancel
Save