Skip to content

Commit

Permalink
avm2: Properly push coerced value back to stack in optimizer for Coer…
Browse files Browse the repository at this point in the history
…ce op
  • Loading branch information
Lord-McSweeney authored and Lord-McSweeney committed Mar 26, 2024
1 parent 98cbe9c commit 99ea774
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/avm2/optimize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 99ea774

Please sign in to comment.