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>

source

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.

source

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.

source

pub fn print_yaml(&self)

Print results serialized as YAML to stdout

source

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.

source

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.

source

pub fn get_graph(&self) -> &Graph<'_>

Get the underlying graph of the computation.

source

pub fn get_context(&self) -> &Context<'_>

Get the context object of the computation.

source

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.

source

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.

source

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>

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>

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>

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>

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>

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>

Evaluate the value of the given parameter at the given jump instruction.

§

type ValueDomain = DataDomain<IntervalDomain>

The type of the returned values. Usually this should be an AbstractDomain, although this is not strictly required.
source§

fn eval_at_node(&self, node: NodeIndex, expression: &Expression) -> Option<Data>

Evaluate the given expression at the given node of the graph that the value set analysis was computed on.
source§

fn get_call_renaming_map( &self, call: &Tid ) -> Option<&BTreeMap<AbstractIdentifier, Self::ValueDomain>>

Returns the mapping of abstract identfiers in the callee to values in the caller for the given call.

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for PointerInference<'a>

§

impl<'a> Send for PointerInference<'a>

§

impl<'a> Sync for PointerInference<'a>

§

impl<'a> Unpin for PointerInference<'a>

§

impl<'a> UnwindSafe for PointerInference<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.