You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
747 B
30 lines
747 B
5 years ago
|
(*
|
||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*)
|
||
|
open! IStd
|
||
|
|
||
|
(** Dereference rule should be checked every type an object is dereferenced.
|
||
|
The rule checks if the reference is nullable.
|
||
|
*)
|
||
|
|
||
|
type violation [@@deriving compare]
|
||
|
|
||
|
val check : Nullability.t -> (unit, violation) result
|
||
|
|
||
|
type dereference_type =
|
||
|
| MethodCall of Typ.Procname.t
|
||
|
| AccessToField of Typ.Fieldname.t
|
||
|
| AccessByIndex of {index_desc: string}
|
||
|
| ArrayLengthAccess
|
||
|
[@@deriving compare]
|
||
|
|
||
|
val violation_description :
|
||
|
violation
|
||
|
-> dereference_type
|
||
|
-> nullable_object_descr:string option
|
||
|
-> origin_descr:string
|
||
|
-> string
|