avm2: Implement Op::Lf64
This commit is contained in:
parent
b4736413fa
commit
9ffa4f1f50
|
@ -705,6 +705,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
|
||||||
Op::Li16 => self.op_li16(),
|
Op::Li16 => self.op_li16(),
|
||||||
Op::Li32 => self.op_li32(),
|
Op::Li32 => self.op_li32(),
|
||||||
Op::Lf32 => self.op_lf32(),
|
Op::Lf32 => self.op_lf32(),
|
||||||
|
Op::Lf64 => self.op_lf64(),
|
||||||
_ => self.unknown_op(op),
|
_ => self.unknown_op(op),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2677,6 +2678,28 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
|
||||||
Ok(FrameControl::Continue)
|
Ok(FrameControl::Continue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Implements `Op::Lf64`
|
||||||
|
fn op_lf64(&mut self) -> Result<FrameControl<'gc>, Error> {
|
||||||
|
let address = self.context.avm2.pop().coerce_to_u32(self)? as usize;
|
||||||
|
|
||||||
|
let dm = self.domain_memory().expect("Not domain memory?");
|
||||||
|
let r = dm.read();
|
||||||
|
let val = r.get_range(address..address + 8);
|
||||||
|
drop(dm);
|
||||||
|
|
||||||
|
if let Some(val) = val {
|
||||||
|
let buf: [u8; 8] = [val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]];
|
||||||
|
|
||||||
|
self.context
|
||||||
|
.avm2
|
||||||
|
.push(Value::Number(f64::from_le_bytes(buf)));
|
||||||
|
} else {
|
||||||
|
return Err("RangeError: The specified range is invalid".into());
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(FrameControl::Continue)
|
||||||
|
}
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
#[cfg(avm_debug)]
|
#[cfg(avm_debug)]
|
||||||
fn op_debug(
|
fn op_debug(
|
||||||
|
|
Loading…
Reference in New Issue