Struct StackBehavior
pub struct StackBehavior {
pub pops: u8,
pub pushes: u8,
pub net_effect: i8,
}Expand description
Stack effect of an instruction.
Describes how an instruction modifies the evaluation stack. This information is crucial for stack analysis, type inference, and verification.
§Examples
use dotscope::disassembler::StackBehavior;
// An instruction that pops 2 values and pushes 1 (like 'add')
let add_behavior = StackBehavior {
pops: 2,
pushes: 1,
net_effect: -1,
};
// An instruction that only pushes (like 'ldloc')
let load_behavior = StackBehavior {
pops: 0,
pushes: 1,
net_effect: 1,
};Fields§
§pops: u8Number of items popped from stack
pushes: u8Number of items pushed to stack
net_effect: i8Net effect on stack depth (pushes - pops)
Trait Implementations§
§impl Clone for StackBehavior
impl Clone for StackBehavior
§fn clone(&self) -> StackBehavior
fn clone(&self) -> StackBehavior
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for StackBehavior
impl Debug for StackBehavior
§impl PartialEq for StackBehavior
impl PartialEq for StackBehavior
impl Copy for StackBehavior
impl Eq for StackBehavior
impl StructuralPartialEq for StackBehavior
Auto Trait Implementations§
impl Freeze for StackBehavior
impl RefUnwindSafe for StackBehavior
impl Send for StackBehavior
impl Sync for StackBehavior
impl Unpin for StackBehavior
impl UnwindSafe for StackBehavior
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more