diff --git a/core/src/avm2/activation.rs b/core/src/avm2/activation.rs index 3b609298c..25c5d35ce 100644 --- a/core/src/avm2/activation.rs +++ b/core/src/avm2/activation.rs @@ -705,6 +705,7 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> { Op::Li16 => self.op_li16(), Op::Li32 => self.op_li32(), Op::Lf32 => self.op_lf32(), + Op::Lf64 => self.op_lf64(), _ => self.unknown_op(op), }; @@ -2677,6 +2678,28 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> { Ok(FrameControl::Continue) } + /// Implements `Op::Lf64` + fn op_lf64(&mut self) -> Result, 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)] #[cfg(avm_debug)] fn op_debug(