[biabduction] Delete UNARY_MINUS_APPLIED_TO_UNSIGNED_EXPRESSION

Summary: This is unused so we can delete it.

Reviewed By: ezgicicek

Differential Revision: D22184609

fbshipit-source-id: 42dfaffc3
master
Dulma Churchill 4 years ago committed by Facebook GitHub Bot
parent a7cca8a734
commit b888e33e1f

@ -495,8 +495,6 @@ OPTIONS
Symexec_memory_error (enabled by default),
THREAD_SAFETY_VIOLATION (enabled by default),
TOPL_ERROR (enabled by default),
UNARY_MINUS_APPLIED_TO_UNSIGNED_EXPRESSION (disabled by
default),
UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK (enabled by default),
UNINITIALIZED_VALUE (enabled by default),
UNREACHABLE_CODE (enabled by default),

@ -220,8 +220,6 @@ OPTIONS
Symexec_memory_error (enabled by default),
THREAD_SAFETY_VIOLATION (enabled by default),
TOPL_ERROR (enabled by default),
UNARY_MINUS_APPLIED_TO_UNSIGNED_EXPRESSION (disabled by
default),
UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK (enabled by default),
UNINITIALIZED_VALUE (enabled by default),
UNREACHABLE_CODE (enabled by default),

@ -495,8 +495,6 @@ OPTIONS
Symexec_memory_error (enabled by default),
THREAD_SAFETY_VIOLATION (enabled by default),
TOPL_ERROR (enabled by default),
UNARY_MINUS_APPLIED_TO_UNSIGNED_EXPRESSION (disabled by
default),
UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK (enabled by default),
UNINITIALIZED_VALUE (enabled by default),
UNREACHABLE_CODE (enabled by default),

@ -564,23 +564,6 @@ let desc_registered_observer_being_deallocated pvar loc =
; tags= !tags }
let desc_unary_minus_applied_to_unsigned_expression expr_str_opt typ_str loc =
let tags = Tags.create () in
let expression =
match expr_str_opt with
| Some s ->
Tags.update tags Tags.value s ;
"expression " ^ s
| None ->
"an expression"
in
let description =
Format.asprintf "A unary minus is applied to %a of type %s %s" MF.pp_monospaced expression
typ_str (at_line tags loc)
in
{no_desc with descriptions= [description]; tags= !tags}
let desc_skip_function proc_name =
let tags = Tags.create () in
let proc_name_str = Procname.to_string proc_name in

@ -135,9 +135,6 @@ val desc_skip_function : Procname.t -> error_desc
val desc_inherently_dangerous_function : Procname.t -> error_desc
val desc_unary_minus_applied_to_unsigned_expression :
string option -> string -> Location.t -> error_desc
val desc_uninitialized_dangling_pointer_deref : deref_str -> string -> Location.t -> error_desc
val access_desc : access option -> string list

@ -889,10 +889,6 @@ let complexity_increase ~kind ~is_on_ui_thread =
let topl_error = register ~id:"TOPL_ERROR" Error TOPL ~user_documentation:"Experimental."
let unary_minus_applied_to_unsigned_expression =
register ~enabled:false ~id:"UNARY_MINUS_APPLIED_TO_UNSIGNED_EXPRESSION" Warning
Biabduction (* TODO *) ~user_documentation:""
let _unavailable_api_in_supported_ios_sdk =
register ~id:"UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK" Warning Linters

@ -318,8 +318,6 @@ val thread_safety_violation : t
val topl_error : t
val unary_minus_applied_to_unsigned_expression : t
val uninitialized_value : t
val unreachable_code_after : t

@ -73,8 +73,6 @@ exception Skip_function of Localise.error_desc
exception Symexec_memory_error of L.ocaml_pos
exception Unary_minus_applied_to_unsigned_expression of Localise.error_desc * L.ocaml_pos
exception Wrong_argument_number of L.ocaml_pos
let recognize_exception exn : IssueToReport.t =
@ -169,10 +167,6 @@ let recognize_exception exn : IssueToReport.t =
{ issue_type= IssueType.symexec_memory_error
; description= Localise.no_desc
; ocaml_pos= Some ocaml_pos }
| Unary_minus_applied_to_unsigned_expression (desc, ocaml_pos) ->
{ issue_type= IssueType.unary_minus_applied_to_unsigned_expression
; description= desc
; ocaml_pos= Some ocaml_pos }
| Wrong_argument_number ocaml_pos ->
{ issue_type= IssueType.wrong_argument_number
; description= Localise.no_desc

@ -72,8 +72,6 @@ exception Skip_function of Localise.error_desc
exception Symexec_memory_error of Logging.ocaml_pos
exception Unary_minus_applied_to_unsigned_expression of Localise.error_desc * Logging.ocaml_pos
exception Wrong_argument_number of Logging.ocaml_pos
val handle_exception : exn -> bool

@ -412,15 +412,7 @@ let check_arith_norm_exp {InterproceduralAnalysis.proc_desc; err_log; tenv} exp
let exn = Exceptions.Divide_by_zero (desc, __POS__) in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn ;
(Prop.exp_normalize_prop tenv prop exp, prop')
| Some (Attribute.UminusUnsigned (e, typ)), prop' ->
let desc =
Errdesc.explain_unary_minus_applied_to_unsigned_expression tenv e typ
(AnalysisState.get_node_exn ()) (AnalysisState.get_loc_exn ())
in
let exn = Exceptions.Unary_minus_applied_to_unsigned_expression (desc, __POS__) in
BiabductionReporting.log_issue_deprecated_using_state proc_desc err_log exn ;
(Prop.exp_normalize_prop tenv prop exp, prop')
| None, prop' ->
| Some (Attribute.UminusUnsigned _), prop' | None, prop' ->
(Prop.exp_normalize_prop tenv prop exp, prop')

@ -1100,17 +1100,5 @@ let explain_condition_always_true_false tenv i cond node loc =
Localise.desc_condition_always_true_false i cond_str_opt loc
(** explain unary minus applied to unsigned expression *)
let explain_unary_minus_applied_to_unsigned_expression tenv exp typ node loc =
let exp_str_opt =
match exp_rv_dexp tenv node exp with Some de -> Some (DExp.to_string de) | None -> None
in
let typ_str =
let pp fmt = Typ.pp_full Pp.text fmt typ in
F.asprintf "%t" pp
in
Localise.desc_unary_minus_applied_to_unsigned_expression exp_str_opt typ_str loc
let warning_err loc fmt_string =
L.(debug Analysis Medium) ("%a: Warning: " ^^ fmt_string) Location.pp loc

@ -72,10 +72,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_unary_minus_applied_to_unsigned_expression :
Tenv.t -> Exp.t -> Typ.t -> Procdesc.Node.t -> Location.t -> Localise.error_desc
(** explain unary minus applied to unsigned expression *)
val explain_leak :
Tenv.t
-> Predicates.hpred

Loading…
Cancel
Save