From 7a4a4f7c9aa53b1b9aaa9e2b4876a9948061b928 Mon Sep 17 00:00:00 2001 From: EmperorBale Date: Sat, 18 Mar 2023 15:59:36 -0700 Subject: [PATCH] avm2: Fix function double borrow panic --- core/src/avm2/object/function_object.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/avm2/object/function_object.rs b/core/src/avm2/object/function_object.rs index 67043befb..ca457beea 100644 --- a/core/src/avm2/object/function_object.rs +++ b/core/src/avm2/object/function_object.rs @@ -181,10 +181,10 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> { arguments: &[Value<'gc>], activation: &mut Activation<'_, 'gc>, ) -> Result, Error<'gc>> { - self.0 - .read() - .exec - .exec(receiver, arguments, activation, self.into()) + // NOTE: Cloning an executable does not allocate new memory + let exec = self.0.read().exec.clone(); + + exec.exec(receiver, arguments, activation, self.into()) } fn construct(