pub enum Terminator {
Fallthrough,
UnconditionalBranch {
target: VAddr,
},
ConditionalBranch {
taken: VAddr,
fallthrough: VAddr,
},
Return,
IndirectBranch,
InvalidOrUnreachable,
}Expand description
How control flow leaves a basic block.
Calls are deliberately not terminators: the standard CFG convention
treats a call as a regular instruction whose semantics include
transferring control elsewhere and eventually returning.
Variants§
Fallthrough
Reached only at the very end of a function whose body simply
ran out of recorded bytes (e.g. nops for alignment with no
branch back). Rare in real code but possible.
UnconditionalBranch
Unconditional direct branch (jmp rel32, etc.) to a known target.
ConditionalBranch
Conditional direct branch (jcc); has both a taken target and a
fall-through edge to the next address.
Return
Return from function (ret, iret, etc.).
IndirectBranch
Indirect branch or call where the target is not a constant
(jmp rax, jmp [rip+...], call rax). Static analysis can’t
resolve these; downstream passes may attempt jump-table
recovery.
InvalidOrUnreachable
ud2, int3 reaching here as a terminator, or any other
instruction that surfaces as flow-control “exception” /
“interrupt” / “unreachable”.
Trait Implementations§
Source§impl Clone for Terminator
impl Clone for Terminator
Source§fn clone(&self) -> Terminator
fn clone(&self) -> Terminator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Terminator
impl Debug for Terminator
Source§impl PartialEq for Terminator
impl PartialEq for Terminator
Source§fn eq(&self, other: &Terminator) -> bool
fn eq(&self, other: &Terminator) -> bool
self and other values to be equal, and is used by ==.