Skip to content

Commit

Permalink
avm2: Activation class is now guaranteed in op_new_activation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-McSweeney authored and Lord-McSweeney committed Mar 23, 2024
1 parent af19d6f commit ab254c9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions core/src/avm2/activation.rs
Expand Up @@ -1830,12 +1830,10 @@ impl<'a, 'gc> Activation<'a, 'gc> {
}

fn op_new_activation(&mut self) -> Result<FrameControl<'gc>, Error<'gc>> {
let instance = if let Some(activation_class) = self.activation_class {
activation_class.construct(self, &[])?
} else {
// TODO: we might want this to be a proper Object instance, just in case
ScriptObject::custom_object(self.context.gc_context, None, None)
};
let instance = self
.activation_class
.expect("Activation class should exist for bytecode")
.construct(self, &[])?;

self.push_stack(instance);

Expand Down

0 comments on commit ab254c9

Please sign in to comment.