pub struct PointerInference<'a> {
pub collected_logs: (Vec<LogMessage>, Vec<CweWarning>),
/* private fields */
}
Expand description
A wrapper struct for the pointer inference computation object. Also contains different analysis results computed through the fixpoint computation including generated log messages.
Fields§
§collected_logs: (Vec<LogMessage>, Vec<CweWarning>)
The log messages and CWE warnings that have been generated during the pointer inference analysis.
Implementations§
source§impl<'a> PointerInference<'a>
impl<'a> PointerInference<'a>
sourcepub fn new(
analysis_results: &'a AnalysisResults<'a>,
config: Config,
log_sender: Sender<LogThreadMsg>,
print_stats: bool
) -> PointerInference<'a>
pub fn new( analysis_results: &'a AnalysisResults<'a>, config: Config, log_sender: Sender<LogThreadMsg>, print_stats: bool ) -> PointerInference<'a>
Generate a new pointer inference computation for a project.
sourcepub fn compute(&mut self, print_stats: bool)
pub fn compute(&mut self, print_stats: bool)
Compute the fixpoint of the pointer inference analysis.
Has a max_steps
bound for the fixpoint algorithm to prevent infinite loops.
If print_stats
is true
then some extra log messages with statistics about the computation are generated.
sourcepub fn print_yaml(&self)
pub fn print_yaml(&self)
Print results serialized as YAML to stdout
sourcepub fn generate_compact_json(&self) -> Value
pub fn generate_compact_json(&self) -> Value
Generate a compacted json representation of the results. Note that this output cannot be used for serialization/deserialization, but is only intended for user output and debugging.
sourcepub fn print_compact_json(&self)
pub fn print_compact_json(&self)
Print a compacted json representation of the results to stdout. Note that this output cannot be used for serialization/deserialization, but is only intended for user output and debugging.
sourcepub fn get_context(&self) -> &Context<'_>
pub fn get_context(&self) -> &Context<'_>
Get the context object of the computation.
sourcepub fn get_node_value(&self, node_id: NodeIndex) -> Option<&NodeValue<State>>
pub fn get_node_value(&self, node_id: NodeIndex) -> Option<&NodeValue<State>>
Get the value associated to a node in the computed fixpoint
(or intermediate state of the algorithm if the fixpoint has not been reached yet).
Returns None
if no value is associated to the Node.
sourcepub fn get_state_at_jmp_tid(&self, jmp_tid: &Tid) -> Option<&State>
pub fn get_state_at_jmp_tid(&self, jmp_tid: &Tid) -> Option<&State>
Get the state of the fixpoint computation at the block end node before the given jump instruction. This function only yields results after the fixpoint has been computed.
sourcepub fn get_id_renaming_map_at_call_tid(
&self,
call_tid: &Tid
) -> Option<&BTreeMap<AbstractIdentifier, Data>>
pub fn get_id_renaming_map_at_call_tid( &self, call_tid: &Tid ) -> Option<&BTreeMap<AbstractIdentifier, Data>>
Get the mapping from callee IDs to caller values for the given call. This function only yields results after the fixpoint has been computed.
Note that the maps may contain mappings from callee IDs to temporary caller IDs that get instantly removed from the caller since they are not referenced in any caller object.
Trait Implementations§
source§impl<'a> VsaResult for PointerInference<'a>
impl<'a> VsaResult for PointerInference<'a>
Implementation of the VsaResult
trait for providing other analyses with an easy-to-use interface
to use the value set and points-to analysis results of the pointer inference.
source§fn eval_address_at_def(&self, def_tid: &Tid) -> Option<Data>
fn eval_address_at_def(&self, def_tid: &Tid) -> Option<Data>
Return the value of the address at the given read or store instruction.
source§fn eval_value_at_def(&self, def_tid: &Tid) -> Option<Data>
fn eval_value_at_def(&self, def_tid: &Tid) -> Option<Data>
Return the assigned value for store or assignment instructions or the value read for load instructions.
source§fn eval_at_jmp(&self, jmp_tid: &Tid, expression: &Expression) -> Option<Data>
fn eval_at_jmp(&self, jmp_tid: &Tid, expression: &Expression) -> Option<Data>
Evaluate the value of the given expression at the given jump instruction.
source§fn eval_parameter_arg_at_call(
&self,
jmp_tid: &Tid,
parameter: &Arg
) -> Option<Data>
fn eval_parameter_arg_at_call( &self, jmp_tid: &Tid, parameter: &Arg ) -> Option<Data>
Evaluate the value of the given parameter at the given jump instruction.
source§fn eval_parameter_location_at_call(
&self,
jmp_tid: &Tid,
parameter: &AbstractLocation
) -> Option<Data>
fn eval_parameter_location_at_call( &self, jmp_tid: &Tid, parameter: &AbstractLocation ) -> Option<Data>
Evaluate the value of the given parameter at the given jump instruction.
§type ValueDomain = DataDomain<IntervalDomain>
type ValueDomain = DataDomain<IntervalDomain>
AbstractDomain
,
although this is not strictly required.