Added AVM2 op "Swap"
This commit is contained in:
parent
0e39cd07ce
commit
8baf35e7af
|
@ -516,6 +516,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
|
||||||
Op::RShift => self.op_rshift(),
|
Op::RShift => self.op_rshift(),
|
||||||
Op::Subtract => self.op_subtract(),
|
Op::Subtract => self.op_subtract(),
|
||||||
Op::SubtractI => self.op_subtract_i(),
|
Op::SubtractI => self.op_subtract_i(),
|
||||||
|
Op::Swap => self.op_swap(),
|
||||||
Op::URShift => self.op_urshift(),
|
Op::URShift => self.op_urshift(),
|
||||||
Op::Jump { offset } => self.op_jump(offset, reader),
|
Op::Jump { offset } => self.op_jump(offset, reader),
|
||||||
Op::IfTrue { offset } => self.op_if_true(offset, reader),
|
Op::IfTrue { offset } => self.op_if_true(offset, reader),
|
||||||
|
@ -1731,6 +1732,16 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
|
||||||
Ok(FrameControl::Continue)
|
Ok(FrameControl::Continue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn op_swap(&mut self) -> Result<FrameControl<'gc>, Error> {
|
||||||
|
let value2 = self.context.avm2.pop().coerce_to_i32(self)?;
|
||||||
|
let value1 = self.context.avm2.pop().coerce_to_i32(self)?;
|
||||||
|
|
||||||
|
self.context.avm2.push(value2);
|
||||||
|
self.context.avm2.push(value1);
|
||||||
|
|
||||||
|
Ok(FrameControl::Continue)
|
||||||
|
}
|
||||||
|
|
||||||
fn op_urshift(&mut self) -> Result<FrameControl<'gc>, Error> {
|
fn op_urshift(&mut self) -> Result<FrameControl<'gc>, Error> {
|
||||||
let value2 = self.context.avm2.pop().coerce_to_u32(self)?;
|
let value2 = self.context.avm2.pop().coerce_to_u32(self)?;
|
||||||
let value1 = self.context.avm2.pop().coerce_to_u32(self)?;
|
let value1 = self.context.avm2.pop().coerce_to_u32(self)?;
|
||||||
|
|
Loading…
Reference in New Issue