Struct cwe_checker_lib::analysis::expression_propagation::Context
source · pub struct Context<'a> { /* private fields */ }
Expand description
The context struct for the expression propagation fixpoint computation.
The computation is a intra procedural forward fixpoint calculation that stores at each node the set of registers with their propagated expressions. This expressions can be used for expression propagation among basic blocks.
Implementations§
Trait Implementations§
source§impl<'a> Context<'a> for Context<'a>
impl<'a> Context<'a> for Context<'a>
source§fn merge(&self, value1: &Self::Value, value2: &Self::Value) -> Self::Value
fn merge(&self, value1: &Self::Value, value2: &Self::Value) -> Self::Value
Merges two values by intersecting their variable-expression pairs.
source§fn update_def(
&self,
value: &Self::Value,
def: &Term<Def>
) -> Option<Self::Value>
fn update_def( &self, value: &Self::Value, def: &Term<Def> ) -> Option<Self::Value>
Adds the expression for the assigned variable to the table.
Invalid pairs are removed and new expressions are supplemented if possible.
§type Value = HashMap<Variable, Expression>
type Value = HashMap<Variable, Expression>
The type of the values that are assigned to nodes during the fixpoint computation.
source§fn get_graph(&self) -> &Graph<'a>
fn get_graph(&self) -> &Graph<'a>
Get a reference to the graph that the fixpoint is computed on.
source§fn update_call_stub(
&self,
_value_before_call: &Self::Value,
_call: &Term<Jmp>
) -> Option<Self::Value>
fn update_call_stub( &self, _value_before_call: &Self::Value, _call: &Term<Jmp> ) -> Option<Self::Value>
Transition function for calls to functions not contained in the binary.
The corresponding edge goes from the callsite to the returned-to block.
source§fn update_jump(
&self,
value: &Self::Value,
_jump: &Term<Jmp>,
_untaken_conditional: Option<&Term<Jmp>>,
_target: &Term<Blk>
) -> Option<Self::Value>
fn update_jump( &self, value: &Self::Value, _jump: &Term<Jmp>, _untaken_conditional: Option<&Term<Jmp>>, _target: &Term<Blk> ) -> Option<Self::Value>
Transition function for (conditional and unconditional)
Jmp
terms.source§fn update_call(
&self,
_value: &Self::Value,
_call: &Term<Jmp>,
_target: &Node<'_>,
_calling_convention: &Option<String>
) -> Option<Self::Value>
fn update_call( &self, _value: &Self::Value, _call: &Term<Jmp>, _target: &Node<'_>, _calling_convention: &Option<String> ) -> Option<Self::Value>
Transition function for in-program calls.
source§fn update_return(
&self,
_value: Option<&Self::Value>,
_value_before_call: Option<&Self::Value>,
_call_term: &Term<Jmp>,
_return_term: &Term<Jmp>,
_calling_convention: &Option<String>
) -> Option<Self::Value>
fn update_return( &self, _value: Option<&Self::Value>, _value_before_call: Option<&Self::Value>, _call_term: &Term<Jmp>, _return_term: &Term<Jmp>, _calling_convention: &Option<String> ) -> Option<Self::Value>
Transition function for return instructions.
Has access to the value at the callsite corresponding to the return edge.
This way one can recover caller-specific information on return from a function.
source§fn specialize_conditional(
&self,
value: &Self::Value,
_condition: &Expression,
_block_before_condition: &Term<Blk>,
_is_true: bool
) -> Option<Self::Value>
fn specialize_conditional( &self, value: &Self::Value, _condition: &Expression, _block_before_condition: &Term<Blk>, _is_true: bool ) -> Option<Self::Value>
This function is used to refine the value using the information on which branch was taken on a conditional jump.
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Context<'a>
impl<'a> Send for Context<'a>
impl<'a> Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnwindSafe for Context<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more