Impl `pop`, which is the opposite of `dup`; and also the opposite of all the `push` instructions.
Confusingly, this one isn't documented in the AVM2 spec at all, but it's method of operation is fairly obvious.
This commit is contained in:
parent
9496fbde0a
commit
1cc8954747
|
@ -439,6 +439,7 @@ impl<'gc> Avm2<'gc> {
|
|||
Op::PushTrue => self.op_push_true(),
|
||||
Op::PushUint { value } => self.op_push_uint(value),
|
||||
Op::PushUndefined => self.op_push_undefined(),
|
||||
Op::Pop => self.op_pop(),
|
||||
Op::Dup => self.op_dup(),
|
||||
Op::GetLocal { index } => self.op_get_local(index),
|
||||
Op::SetLocal { index } => self.op_set_local(context, index),
|
||||
|
@ -580,6 +581,12 @@ impl<'gc> Avm2<'gc> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn op_pop(&mut self) -> Result<(), Error> {
|
||||
self.pop();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn op_dup(&mut self) -> Result<(), Error> {
|
||||
self.push(self.stack.last().cloned().unwrap_or(Value::Undefined));
|
||||
|
||||
|
|
Loading…
Reference in New Issue