Frama-C API - Locals_scoping
Auxiliary functions to mark invalid (more precisely 'escaping') the references to a variable whose scope ends.
Set of bases that might contain a reference to a local or formal variable. Those references must be marked as dangling once we leave the scope of those local or formals.
val packed_descr : Frama_c_kernel.Structural_descr.packval bottom : unit -> clobbered_setval top : unit -> clobbered_setval remember_bases_with_locals : clobbered_set -> Frama_c_kernel.Base.SetLattice.t -> unitAdd the given set of bases to an existing clobbered set
val remember_if_locals_in_value : clobbered_set -> Frama_c_kernel.Locations.location -> Frama_c_kernel.Cvalue.V.t -> unitremember_locals_in_value clob loc v adds all bases pointed to by loc to clob if v contains the address of a local or formal
val offsetmap_contains_local : Frama_c_kernel.Cvalue.V_Offsetmap.t -> boolval make_escaping : exact:bool -> escaping:Frama_c_kernel.Base.Hptset.t -> on_escaping: (b:Frama_c_kernel.Base.t -> itv:(Frama_c_kernel.Z.t * Frama_c_kernel.Z.t) -> v:Frama_c_kernel.Cvalue.V.t -> unit) -> within:Frama_c_kernel.Base.SetLattice.t -> Frama_c_kernel.Cvalue.Model.t -> Frama_c_kernel.Cvalue.Model.tmake_escaping ~exact ~escaping ~on_escaping ~within state changes all references to the variables in escaping to "escaping address". All such references must be in the offsetmaps bound to within. on_escaping b itv v is called when a reference is found: v is the value that refers to escaping, b is the base in which v appears (included in within) and itv is the offset at which v appears. If exact holds, a strong update is performed. Otherwise, only a week update is executed.
val make_escaping_fundec : Frama_c_kernel.Cil_types.fundec -> clobbered_set -> Frama_c_kernel.Cil_types.varinfo list -> Frama_c_kernel.Cvalue.Model.t -> Frama_c_kernel.Cvalue.Model.tmake_escaping_fundec fdec clob l state changes all references to the local or formal variables in l to "escaping". All pointers to l should be in the offsetmap bound to the variables contained in clob. fdec is used to detect whether we are deallocating the outer scope of a function, in which case a different warning is emitted.
val substitute : Frama_c_kernel.Base.substitution -> clobbered_set -> Frama_c_kernel.Cvalue.Model.t -> Frama_c_kernel.Cvalue.Model.tsubstitute substitution clob state applies substitution to all pointer values in the offsetmaps bound to variables in clob in state.
