Struct cwe_checker_lib::intermediate_representation::Term
source · pub struct Term<T> {
pub tid: Tid,
pub term: T,
}
Expand description
A term is an object inside a binary with an address and an unique ID (both contained in the tid
).
Fields§
§tid: Tid
The term identifier, which also contains the address of the term
term: T
The object
Implementations§
source§impl Term<Def>
impl Term<Def>
sourcepub fn check_for_zero_extension(
&self,
output_name: String,
output_sub_register: String
) -> Option<Tid>
pub fn check_for_zero_extension( &self, output_name: String, output_sub_register: String ) -> Option<Tid>
This function checks whether the instruction is a zero extension of the overwritten sub register of the previous instruction. If so, returns its TID
sourcepub fn substitute_input_var(
&mut self,
input_var: &Variable,
replace_with_expression: &Expression
)
pub fn substitute_input_var( &mut self, input_var: &Variable, replace_with_expression: &Expression )
Substitute every occurence of input_var
in the address and value expressions
with replace_with_expression
.
Does not change the target variable of assignment- and load-instructions.
source§impl Term<Blk>
impl Term<Blk>
sourcepub fn remove_nonexisting_indirect_jump_targets(
&mut self,
all_jump_targets: &HashSet<Tid>
) -> Result<(), Vec<LogMessage>>
pub fn remove_nonexisting_indirect_jump_targets( &mut self, all_jump_targets: &HashSet<Tid> ) -> Result<(), Vec<LogMessage>>
Remove indirect jump target addresses for which no corresponding target block exists.
Returns an error message for each removed address.
sourcepub fn artificial_sink(id_suffix: &str) -> Self
pub fn artificial_sink(id_suffix: &str) -> Self
Returns a new artificial sink block with the given suffix attached to its ID.
source§impl Term<Sub>
impl Term<Sub>
sourcepub fn has_artifical_sink(&self) -> bool
pub fn has_artifical_sink(&self) -> bool
Returns true iff the function has an artificial sink block.
sourcepub fn artificial_sink() -> Self
pub fn artificial_sink() -> Self
Returns a new artificial sink sub.
sourcepub fn add_artifical_sink(&mut self) -> bool
pub fn add_artifical_sink(&mut self) -> bool
Adds an artificial sink block if there is none.
Returns true iff the artificial sink block was added.
source§impl Term<Sub>
impl Term<Sub>
sourcepub fn into_ir_sub_term(self, generic_pointer_size: ByteSize) -> Term<IrSub>
pub fn into_ir_sub_term(self, generic_pointer_size: ByteSize) -> Term<IrSub>
Convert a Sub
term in the P-Code representation to a Sub
term in the intermediate representation.
The conversion also repairs the order of the basic blocks in the blocks
array of the Sub
in the sense that the first block of the array is required to also be the function entry point
after the conversion.
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Term<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Term<T>where
T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<T: PartialEq> PartialEq for Term<T>
impl<T: PartialEq> PartialEq for Term<T>
impl<T: Eq> Eq for Term<T>
impl<T> StructuralEq for Term<T>
impl<T> StructuralPartialEq for Term<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Term<T>where
T: RefUnwindSafe,
impl<T> Send for Term<T>where
T: Send,
impl<T> Sync for Term<T>where
T: Sync,
impl<T> Unpin for Term<T>where
T: Unpin,
impl<T> UnwindSafe for Term<T>where
T: UnwindSafe,
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.