Module BO__BufferOverrunDomain.AliasTarget
type alias_typ=type t=|Simple of{i : IR.IntLit.t;java_tmp : BO.AbsLoc.Loc.t option;}Since Sil distinguishes logical and program variables, we need a relation for pruning values of program variables. For example, a C statement
if(x){...}is translated to%r=load(x); if(%r){...}in Sil. At the load statement, we record the alias between the values of%randx, then we can prune not only the value of%r, but also that ofxinside the if branch. Thejava_tmpfield is an additional slot for keeping one more alias of temporary variable in Java. Theifield is to express%r=load(x)+i.|EmptyFor pruning
vector.lengthwithvector::empty()results, we adopt a specific relation between%randv->elements, where%r=v.empty(). So, if%r!=0,v's array length (v->elements->length) is pruned by=0. On the other hand, if%r==0,v's array length is pruned by>=1.|Size of{alias_typ : alias_typ;i : IR.IntLit.t;java_tmp : BO.AbsLoc.Loc.t option;}This is for pruning vector's length. When there is a function call,
%r=x.size(), the alias target for%rbecomesAliasTarget.size {l=x.elements}. Thejava_tmpfield is an additional slot for keeping one more alias of temporary variable in Java. Theifield is to express%r=x.size()+i, which is required to follow the semantics ofArray.addinside loops precisely.|FgetsThis is for pruning return values of
fgets. If the result offgetsis not null, the length of return value will be pruned to greater than or equal to 1.|IteratorSimple of{i : IR.IntLit.t;java_tmp : BO.AbsLoc.Loc.t option;}This is for tracking a relation between an iterator offset and an integer value. If
%rhas an alias toIteratorSimple {l; i}, which means that%r's iterator offsetis same tol.|IteratorOffset of{alias_typ : alias_typ;i : IR.IntLit.t;java_tmp : BO.AbsLoc.Loc.t option;}This is for tracking a relation between an iterator offset and the length of the underlying collection. If
%rhas an alias toIteratorOffset {l; i}, which means that%r's iterator offsetis same tolength(l)+i.|IteratorHasNext of{java_tmp : BO.AbsLoc.Loc.t option;}This is for tracking return values of the
hasNextfunction. If%rhas an alias toHasNext {l}, which means that%ris same tol.hasNext().|IteratorNextObject of{objc_tmp : BO.AbsLoc.Loc.t option;}This is for tracking the return values of
nextObjectfunction. If%rhas an alias tonextObject {l}, which means that%ris the same tol.nextObject().|TopRelations between values of logical variables(registers) and program variables
include Absint.AbstractDomain.S with type t := t
include Absint.AbstractDomain.NoJoin
include IStdlib.PrettyPrintable.PrintableType
val pp : IStdlib.PrettyPrintable.F.formatter -> t -> unit