[siof] Make siof reporting closer to other checkers

Summary: Don't use a hardcoded string, and enable reports in --issues-tests.

Reviewed By: jvillard

Differential Revision: D4110731

fbshipit-source-id: 9922557
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent ae7979b416
commit 7fc5b4d55d

@ -79,6 +79,7 @@ let return_statement_missing = "RETURN_STATEMENT_MISSING"
let skip_function = "SKIP_FUNCTION"
let skip_pointer_dereference = "SKIP_POINTER_DEREFERENCE"
let stack_variable_address_escape = "STACK_VARIABLE_ADDRESS_ESCAPE"
let static_initialization_order_fiasco = "STATIC_INITIALIZATION_ORDER_FIASCO"
let strong_delegate_warning = "STRONG_DELEGATE_WARNING"
let tainted_value_reaching_sensitive_function = "TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION"
let unary_minus_applied_to_unsigned_expression = "UNARY_MINUS_APPLIED_TO_UNSIGNED_EXPRESSION"

@ -73,6 +73,7 @@ val return_value_ignored : t
val return_expression_required : t
val return_statement_missing : t
val stack_variable_address_escape : t
val static_initialization_order_fiasco : t
val strong_delegate_warning : t
val unary_minus_applied_to_unsigned_expression : t
val uninitialized_value : t

@ -380,6 +380,7 @@ let should_report (issue_kind: Exceptions.err_kind) issue_type error_desc =>
registered_observer_being_deallocated,
resource_leak,
retain_cycle,
static_initialization_order_fiasco,
strong_delegate_warning,
tainted_value_reaching_sensitive_function,
unsafe_guarded_by_access
@ -593,22 +594,24 @@ let module IssuesTests = {
ekind == Exceptions.Kerror ||
IList.exists
(Localise.equal error_name)
[
Localise.assign_pointer_warning,
Localise.bad_pointer_comparison,
Localise.component_factory_function,
Localise.component_initializer_with_side_effects,
Localise.component_with_multiple_factory_methods,
Localise.component_with_unconventional_superclass,
Localise.cxx_reference_captured_in_objc_block,
Localise.direct_atomic_property_access,
Localise.field_not_null_checked,
Localise.global_variable_initialized_with_function_or_method_call,
Localise.mutable_local_variable_in_component_file,
Localise.parameter_not_null_checked,
Localise.registered_observer_being_deallocated,
Localise.return_value_ignored,
Localise.strong_delegate_warning
Localise.[
assign_pointer_warning,
bad_pointer_comparison,
component_factory_function,
component_initializer_with_side_effects,
component_with_multiple_factory_methods,
component_with_unconventional_superclass,
cxx_reference_captured_in_objc_block,
direct_atomic_property_access,
field_not_null_checked,
global_variable_initialized_with_function_or_method_call,
mutable_local_variable_in_component_file,
parameter_not_null_checked,
quandary_taint_error,
registered_observer_being_deallocated,
return_value_ignored,
static_initialization_order_fiasco,
strong_delegate_warning
];
if (in_footprint && should_report && error_filter source_file error_desc error_name) {
F.fprintf

@ -105,8 +105,8 @@ let report_siof pname loc bad_globals =
unit: %a"
pp_set bad_globals in
let description = pp_to_string pp_desc () in
let exn = Exceptions.Checkers
("STATIC_INITIALIZATION_ORDER_FIASCO", Localise.verbatim_desc description) in
let msg = Localise.to_string Localise.static_initialization_order_fiasco in
let exn = Exceptions.Checkers (msg, Localise.verbatim_desc description) in
Reporting.log_error pname ~loc exn

Loading…
Cancel
Save