Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVM2: Implement avmplus' sort algorithm instead of using the standard Rust sort. #17846

Merged
merged 2 commits into from
Sep 11, 2024

Commits on Sep 11, 2024

  1. tests: add (failing) tests for random Array "sorting"

    These tests fail because we do not implement the exact same algorithm
    as Flash Player:
    - in AVM1, the test produces a different result
    - in AVM2, the test panics because Rust's sort doesn't accomodate
      non-Ord comparison functions
    moulins authored and torokati44 committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    daa0f82 View commit details
    Browse the repository at this point in the history
  2. avm2: replace Rust's sort by avmplus' for Array sorts; unblocks ruf…

    …fle-rs#17812
    
    Replace the use of Rust's standard sort in `Array.sort` and `sortOn` by
    a port of avmplus' QuickSort algorithm. This avoid panics on Rust >=1.81
    when `Array.sort` is called with a non-Ord comparison function, and will
    always produce the same result as Flash Player.
    moulins authored and torokati44 committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    5f3851a View commit details
    Browse the repository at this point in the history