From 070b95971e6d5b27d017af56a77d1508b6505a25 Mon Sep 17 00:00:00 2001 From: Lord-McSweeney Date: Mon, 25 Mar 2024 18:17:03 -0700 Subject: [PATCH] avm2: Properly push coerced value back to stack in optimizer for Coerce op --- core/src/avm2/optimize.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/avm2/optimize.rs b/core/src/avm2/optimize.rs index 84b8a5249098..1e028b7ce186 100644 --- a/core/src/avm2/optimize.rs +++ b/core/src/avm2/optimize.rs @@ -560,6 +560,8 @@ pub fn optimize<'gc>( } Op::Coerce { class } => { let stack_value = stack.pop_or_any(); + stack.push_class(*class); + if stack_value.guaranteed_null { // Coercing null to a non-primitive or void is a noop. if !GcCell::ptr_eq(*class, types.int.inner_class_definition())