pub enum Jmp {
Branch(Tid),
BranchInd(Expression),
CBranch {
target: Tid,
condition: Expression,
},
Call {
target: Tid,
return_: Option<Tid>,
},
CallInd {
target: Expression,
return_: Option<Tid>,
},
Return(Expression),
CallOther {
description: String,
return_: Option<Tid>,
},
}
Expand description
A Jmp
instruction affects the control flow of a program, i.e. it may change the instruction pointer.
With the exception of CallOther
, it has no other side effects.
Jmp
instructions carry some semantic information with it, like whether a jump is intra- or interprocedural.
Note that this semantic information may not always be correct.
Variants§
Branch(Tid)
A direct intraprocedural jump to the targeted Blk
term identifier.
BranchInd(Expression)
An indirect intraprocedural jump to the address that the given expression evaluates to.
CBranch
Fields
condition: Expression
The jump is only taken if this expression evaluates to true
, (i.e. not zero).
A direct intraprocedural jump that is only taken if the condition evaluates to true (i.e. not zero).
Call
Fields
A direct interprocedural jump representing a subroutine call.
Note that this is syntactically equivalent to a Jmp::Branch
.
CallInd
Fields
target: Expression
An expression computing the target address of the call.
An indirect interprocedural jump to the address the target
expression evaluates to
and representing a subroutine call.
Note that this is syntactically equivalent to a Jmp::BranchInd
.
Return(Expression)
A indirect interprocedural jump indicating a return from a subroutine.
Note that this is syntactically equivalent to a Jmp::BranchInd
.
CallOther
Fields
This instruction is used for all side effects that are not representable by other instructions or not supported by the disassembler.
E.g. syscalls and other interrupts are mapped to CallOther
.
Assembly instructions that the disassembler does not support are also mapped to CallOther
.
One can use the description
field to match for and handle known side effects (e.g. syscalls).
Trait Implementations§
source§impl<'de> Deserialize<'de> for Jmp
impl<'de> Deserialize<'de> for Jmp
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>,
impl Eq for Jmp
impl StructuralEq for Jmp
impl StructuralPartialEq for Jmp
Auto Trait Implementations§
impl RefUnwindSafe for Jmp
impl Send for Jmp
impl Sync for Jmp
impl Unpin for Jmp
impl UnwindSafe for Jmp
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.