Skip to content

Commit

Permalink
vm: use stack push_data
Browse files Browse the repository at this point in the history
  • Loading branch information
cdump committed Nov 18, 2024
1 parent b4d8b84 commit ab01c23
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/evm/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,7 @@ where
}
let mut args: [u8; 32] = [0; 32];
args[(32 - n)..].copy_from_slice(&self.code[self.pc + 1..self.pc + 1 + n]);
self.stack.push(Element {
data: args,
label: None,
});
self.stack.push_data(args);
self.pc += n;
Ok(StepResult::new(op, if n == 0 { 2 } else { 3 }))
}
Expand Down Expand Up @@ -291,14 +288,7 @@ where

op::ISZERO => {
let raws0 = self.stack.pop()?;
self.stack.push(Element {
data: if raws0.data == VAL_0_B {
VAL_1_B
} else {
VAL_0_B
},
label: None,
});
self.stack.push_data(if raws0.data == VAL_0_B { VAL_1_B } else { VAL_0_B });
let mut ret = StepResult::new(op, 3);
ret.fa = Some(raws0);
Ok(ret)
Expand Down

0 comments on commit ab01c23

Please sign in to comment.