From dc1131787550233e4c9440b0466deb5c5a44ecfd Mon Sep 17 00:00:00 2001 From: Moulins Date: Tue, 7 Oct 2025 17:23:16 +0200 Subject: [PATCH] avm1: Remove `base_clip_unloaded` flag in `Activation` As the comment in `continue_if_base_clip_exists` said, this doesn't appear to be necessary anymore. --- core/src/avm1/activation.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/core/src/avm1/activation.rs b/core/src/avm1/activation.rs index f7669e43fdf6..8b3f745ddbe3 100644 --- a/core/src/avm1/activation.rs +++ b/core/src/avm1/activation.rs @@ -181,9 +181,6 @@ pub struct Activation<'a, 'gc: 'a> { /// This can be changed with `tellTarget` (via `ActionSetTarget` and `ActionSetTarget2`). target_clip: Option>, - /// Whether the base clip was removed when we started this frame. - base_clip_unloaded: bool, - pub context: &'a mut UpdateContext<'gc>, /// An identifier to refer to this activation by, when debugging. @@ -251,7 +248,6 @@ impl<'a, 'gc> Activation<'a, 'gc> { constant_pool, base_clip, target_clip: Some(base_clip), - base_clip_unloaded: base_clip.avm1_removed(), this, callee, local_registers: None, @@ -274,7 +270,6 @@ impl<'a, 'gc> Activation<'a, 'gc> { constant_pool: self.constant_pool, base_clip: self.base_clip, target_clip: self.target_clip, - base_clip_unloaded: self.base_clip_unloaded, this: self.this, callee: self.callee, local_registers: self.local_registers.clone(), @@ -304,7 +299,6 @@ impl<'a, 'gc> Activation<'a, 'gc> { constant_pool: context.avm1.constant_pool(), base_clip, target_clip: Some(base_clip), - base_clip_unloaded: base_clip.avm1_removed(), this: scope.locals_cell().into(), callee: None, local_registers: None, @@ -3077,11 +3071,7 @@ impl<'a, 'gc> Activation<'a, 'gc> { /// If the clip executing a script is removed during execution, return from this activation. /// Should be called after any action that could potentially destroy a clip (gotos, etc.) fn continue_if_base_clip_exists(&self) -> Result, Error<'gc>> { - // The exception is `unload` clip event handlers, which currently are called when the clip - // has already been removed. If this activation started with the base clip already removed, - // this is an unload handler, so allow the code to run regardless. - // (This may no longer be necessary once #1535 is fixed.) - if !self.base_clip_unloaded && self.base_clip.avm1_removed() { + if self.base_clip.avm1_removed() { Ok(FrameControl::Return(ReturnType::Explicit(Value::Undefined))) } else { Ok(FrameControl::Continue)