ArrayDomainAbstract domains for C arrays.
module VDQ = ValueDomainQueriesmodule SizeDomain = PreValueDomain.SizeDomainval get_domain :
varAttr:GoblintCil.Cil.attributes ->
typAttr:GoblintCil.Cil.attributes ->
domaingets the underlying domain: chosen by the attributes in AttributeConfiguredArrayDomain
val can_recover_from_top : domain -> boolSome domains such as Trivial cannot recover from their value ever being top. ValueDomain handles intialization differently for these
module type S0 = sig ... endmodule type S = sig ... endAbstract domains representing arrays.
module type Str = sig ... endAbstract domains representing strings a.k.a. null-terminated char arrays.
module type StrWithDomain = sig ... endmodule type LatticeWithInvalidate = sig ... endmodule type LatticeWithSmartOps = sig ... endmodule type Null = sig ... endmodule type LatticeWithNull = sig ... endThis functor creates a trivial single cell representation of an array. The * indexing type is taken as a parameter to satisfy the type system, it is not * used in the implementation.
module TrivialWithLength
(Val : LatticeWithInvalidate) :
S with type value = Val.tThis functor creates a trivial single cell representation of an array. The * indexing type is also used to manage the length.
module Partitioned (Val : LatticeWithSmartOps) : S with type value = Val.tThis functor creates an array representation that allows for partitioned arrays * Such an array can be partitioned according to an expression in which case it * uses three values from Val to represent the elements of the array to the left, * at, and to the right of the expression. The Idx domain is required only so to * have a signature that allows for choosing an array representation at runtime.
module PartitionedWithLength
(Val : LatticeWithSmartOps) :
S with type value = Val.tLike partitioned but additionally manages the length of the array.
This functor creates an array representation by the indexes of all null bytes * the array must and may contain. This is useful to analyze strings, i.e. null- * terminated char arrays, and particularly to determine if operations on strings * could lead to a buffer overflow. Concrete values from Val are not interesting * for this domain. It additionally tracks the array size.
module AttributeConfiguredArrayDomain
(Val : LatticeWithSmartOps) :
S with type value = Val.tSwitches between PartitionedWithLength, TrivialWithLength and Unroll based on variable, type, and flag.
module AttributeConfiguredAndNullByteArrayDomain
(Val : LatticeWithNull) :
StrWithDomain with type value = Val.tLike FlagHelperAttributeConfiguredArrayDomain but additionally runs NullByte * in parallel if flag "ana.base.arrays.nullbytes" is set.