Trait cwe_checker_lib::analysis::vsa_results::VsaResult
source · pub trait VsaResult {
type ValueDomain;
// Required methods
fn eval_value_at_def(&self, def_tid: &Tid) -> Option<Self::ValueDomain>;
fn eval_address_at_def(&self, def_tid: &Tid) -> Option<Self::ValueDomain>;
fn eval_parameter_arg_at_call(
&self,
jmp_tid: &Tid,
param: &Arg
) -> Option<Self::ValueDomain>;
fn eval_parameter_location_at_call(
&self,
jmp_tid: &Tid,
param: &AbstractLocation
) -> Option<Self::ValueDomain>;
fn eval_at_jmp(
&self,
jmp_tid: &Tid,
expression: &Expression
) -> Option<Self::ValueDomain>;
fn eval_at_node(
&self,
node: NodeIndex,
expression: &Expression
) -> Option<Self::ValueDomain>;
// Provided method
fn get_call_renaming_map(
&self,
_call: &Tid
) -> Option<&BTreeMap<AbstractIdentifier, Self::ValueDomain>> { ... }
}
Expand description
A trait providing an interface for accessing the results of a value set analysis. Note that the returned values may be any type of information associated with values at certain program points, i.e. the trait can also be used for other analyses than just value set analyses.
Every returned value is wrapped into an Option<..>
.
This should mainly be used to indicate that the analysis did not compute a value at a certain point,
e.g. because the code point was deemed to be dead code.
If the analysis wants to indicate that no specific information is known about a certain value
then this should be encoded in the ValueDomain
itself instead of returning None
.
Required Associated Types§
sourcetype ValueDomain
type ValueDomain
The type of the returned values.
Usually this should be an AbstractDomain
,
although this is not strictly required.
Required Methods§
sourcefn eval_value_at_def(&self, def_tid: &Tid) -> Option<Self::ValueDomain>
fn eval_value_at_def(&self, def_tid: &Tid) -> Option<Self::ValueDomain>
Return the value stored for write instructions, the value read for read instructions or the value assigned for assignments.
sourcefn eval_address_at_def(&self, def_tid: &Tid) -> Option<Self::ValueDomain>
fn eval_address_at_def(&self, def_tid: &Tid) -> Option<Self::ValueDomain>
Return the value of the address where something is read or written for read or store instructions.
sourcefn eval_parameter_arg_at_call(
&self,
jmp_tid: &Tid,
param: &Arg
) -> Option<Self::ValueDomain>
fn eval_parameter_arg_at_call( &self, jmp_tid: &Tid, param: &Arg ) -> Option<Self::ValueDomain>
Return the value of a parameter at the given jump instruction.
sourcefn eval_parameter_location_at_call(
&self,
jmp_tid: &Tid,
param: &AbstractLocation
) -> Option<Self::ValueDomain>
fn eval_parameter_location_at_call( &self, jmp_tid: &Tid, param: &AbstractLocation ) -> Option<Self::ValueDomain>
Return the value of a parameter at the given jump instruction.
sourcefn eval_at_jmp(
&self,
jmp_tid: &Tid,
expression: &Expression
) -> Option<Self::ValueDomain>
fn eval_at_jmp( &self, jmp_tid: &Tid, expression: &Expression ) -> Option<Self::ValueDomain>
Evaluate the value of the given expression at the given jump instruction.
sourcefn eval_at_node(
&self,
node: NodeIndex,
expression: &Expression
) -> Option<Self::ValueDomain>
fn eval_at_node( &self, node: NodeIndex, expression: &Expression ) -> Option<Self::ValueDomain>
Evaluate the given expression at the given node of the graph that the value set analysis was computed on.
Provided Methods§
sourcefn get_call_renaming_map(
&self,
_call: &Tid
) -> Option<&BTreeMap<AbstractIdentifier, Self::ValueDomain>>
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.
Implementors§
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.