X Tutup
Skip to content

Avoid reborrow errors in Array methods#23197

Open
SuchAFuriousDeath wants to merge 2 commits intoruffle-rs:masterfrom
SuchAFuriousDeath:array-reentrancy
Open

Avoid reborrow errors in Array methods#23197
SuchAFuriousDeath wants to merge 2 commits intoruffle-rs:masterfrom
SuchAFuriousDeath:array-reentrancy

Conversation

@SuchAFuriousDeath
Copy link
Collaborator

Fixes #21929
Fixes #22922
Fixes #22330
Fixes #22377

I wasn't able to to reproduce, but based on the stack traces and line numbers, all of them should be fixed.

@Lord-McSweeney Lord-McSweeney added A-avm2 Area: AVM2 (ActionScript 3) T-fix Type: Bug fix (in something that's supposed to work already) labels Mar 7, 2026
@SuchAFuriousDeath SuchAFuriousDeath force-pushed the array-reentrancy branch 2 times, most recently from 9af3c05 to 8b2f45b Compare March 9, 2026 23:52

trace("");

// Test indexOf reborrows during hole resolution
Copy link
Collaborator

@Lord-McSweeney Lord-McSweeney Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How could these two test cases (indexOf and lastIndexOf) cause a reborrow?

array_storage.set(i, resolve_array_hole(activation, this, i, item)?);
let item = array_object.storage().get(i);
let resolved = resolve_array_hole(activation, this, i, item)?;
array_object.storage_mut(activation.gc()).set(i, resolved);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to hurt splice performance- I think @kjarosh was trying to improve it in the past? Is this really the fastest we can do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-avm2 Area: AVM2 (ActionScript 3) newsworthy T-fix Type: Bug fix (in something that's supposed to work already)

Projects

None yet

3 participants

X Tutup