Module InferModules.EradicateChecks

Module for the checks called by Eradicate.

val return_nonnull_silent : bool
val get_field_annotation : InferIR.Tenv.t ‑> InferIR.Typ.Fieldname.t ‑> InferIR__Typ.typ ‑> (InferIR__Typ.typ * InferIR.Annot.Item.t) option
val report_error : InferIR.Tenv.t ‑> (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> TypeErr.err_instance ‑> TypeErr.InstrRef.t option ‑> InferBase.Location.t ‑> InferIR.Procdesc.t ‑> unit
val explain_expr : InferIR.Tenv.t ‑> InferIR.Procdesc.Node.t ‑> InferIR.Exp.t ‑> string option
val classify_procedure : InferIR.ProcAttributes.t ‑> string

Classify a procedure.

val is_virtual : (InferIR.Mangled.t * 'a * 'b) list ‑> bool
val check_field_access : InferIR.Tenv.t ‑> (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> InferIR.Procdesc.t ‑> InferIR.Procdesc.Node.t ‑> TypeErr.InstrRef.t ‑> InferIR.Exp.t ‑> InferIR.Typ.Fieldname.t ‑> TypeAnnotation.t ‑> InferBase.Location.t ‑> unit

Check an access (read or write) to a field.

val check_array_access : InferIR.Tenv.t ‑> (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> InferIR.Procdesc.t ‑> InferIR.Procdesc.Node.t ‑> TypeErr.InstrRef.t ‑> InferIR.Exp.t ‑> InferIR.Typ.Fieldname.t ‑> TypeAnnotation.t ‑> InferBase.Location.t ‑> bool ‑> unit

Check an access to an array

type from_call =
| From_condition

(** Direct condition *)

| From_instanceof

(** x instanceof C *)

| From_is_false_on_null

(** returns false on null *)

| From_is_true_on_null

(** returns true on null *)

| From_optional_isPresent

(** x.isPresent *)

| From_containsKey

(** x.containsKey *)

Where the condition is coming from

val compare_from_call : from_call ‑> from_call ‑> int
val equal_from_call : from_call ‑> from_call ‑> bool
val check_condition : InferIR.Tenv.t ‑> bool ‑> (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> InferIR.Procdesc.t ‑> InferIR.Procdesc.Node.t ‑> InferIR.Exp.t ‑> InferIR.Typ.t ‑> TypeAnnotation.t ‑> bool ‑> from_call ‑> Idenv.t ‑> Printer.LineReader.t ‑> InferBase.Location.t ‑> TypeErr.InstrRef.t ‑> unit

Check the normalized "is zero" or "is not zero" condition of a prune instruction.

val check_zero : InferIR.Tenv.t ‑> (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> InferIR.Procdesc.t ‑> InferIR.Procdesc.Node.t ‑> InferIR.Exp.t ‑> InferIR.Typ.t ‑> TypeAnnotation.t ‑> bool ‑> from_call ‑> Idenv.t ‑> Printer.LineReader.t ‑> InferBase.Location.t ‑> TypeErr.InstrRef.t ‑> unit

Check an "is zero" condition.

val check_nonzero : InferIR.Tenv.t ‑> (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> InferIR.Procdesc.t ‑> InferIR.Procdesc.Node.t ‑> InferIR.Exp.t ‑> InferIR.Typ.t ‑> TypeAnnotation.t ‑> bool ‑> from_call ‑> Idenv.t ‑> Printer.LineReader.t ‑> InferBase.Location.t ‑> TypeErr.InstrRef.t ‑> unit

Check an "is not zero" condition.

val check_field_assignment : InferIR.Tenv.t ‑> (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> InferIR.Procdesc.t ‑> 'a ‑> TypeErr.InstrRef.t ‑> 'b ‑> 'c ‑> 'c ‑> 'd ‑> InferBase.Location.t ‑> InferIR.Typ.Fieldname.t ‑> ('e * InferIR.Annot.Item.t) option ‑> ('a ‑> TypeErr.InstrRef.t ‑> InferIR.Procdesc.t ‑> 'b ‑> 'c ‑> ('d * TypeAnnotation.t * InferBase.Location.t list) ‑> InferBase.Location.t ‑> InferIR.Typ.t * TypeAnnotation.t * 'f) ‑> unit

Check an assignment to a field.

val check_constructor_initialization : InferIR.Tenv.t ‑> (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> InferIR.Typ.Procname.t ‑> InferIR.Procdesc.t ‑> InferIR.Procdesc.Node.t ‑> (InferIR.Typ.Procname.t * 'a TypeState.t) InferStdlib.IStd.List.t InferStdlib.IStd.Lazy.t ‑> (InferIR.Typ.Procname.t * 'b TypeState.t) InferStdlib.IStd.List.t InferStdlib.IStd.Lazy.t ‑> InferBase.Location.t ‑> unit

Check that nonnullable fields are initialized in constructors.

val check_return_annotation : InferIR.Tenv.t ‑> (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> InferIR.Procdesc.t ‑> ('a * TypeAnnotation.t * 'b) option ‑> AnnotatedSignature.t ‑> bool ‑> InferBase.Location.t ‑> unit

Check the annotations when returning from a method.

val check_call_receiver : InferIR.Tenv.t ‑> (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> InferIR.Procdesc.t ‑> InferIR.Procdesc.Node.t ‑> 'a ‑> ((InferIR.Exp.t * 'b) * 'c) list ‑> InferIR.Typ.Procname.t ‑> TypeErr.InstrRef.t ‑> InferBase.Location.t ‑> (InferIR.Tenv.t ‑> InferIR.Procdesc.Node.t ‑> TypeErr.InstrRef.t ‑> InferIR.Procdesc.t ‑> 'a ‑> 'b ‑> ('c * TypeAnnotation.t * 'd list) ‑> InferBase.Location.t ‑> 'e * TypeAnnotation.t * 'f) ‑> unit

Check the receiver of a virtual call.

type resolved_param = {
num : int;
formal : InferIR.Mangled.t * TypeAnnotation.t * InferIR.Typ.t;
actual : InferIR.Exp.t * TypeAnnotation.t;
propagates_nullable : bool;
}
val check_call_parameters : InferIR.Tenv.t ‑> (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> InferIR.Procdesc.t ‑> InferIR.Procdesc.Node.t ‑> InferIR.ProcAttributes.t ‑> resolved_param InferStdlib.IStd.List.t ‑> InferBase.Location.t ‑> TypeErr.InstrRef.t ‑> unit

Check the parameters of a call.

val check_overridden_annotations : (InferIR.Procdesc.Node.t ‑> InferIR.Procdesc.Node.t) ‑> InferIR.Tenv.t ‑> InferIR.Typ.Procname.t ‑> InferIR.Procdesc.t ‑> AnnotatedSignature.t ‑> unit

Checks if the annotations are consistent with the inherited class or with the implemented interfaces