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

winch: Sync registers and locals before fuel check #9554

Merged

Commits on Nov 5, 2024

  1. winch: Sync registers and locals before fuel check

    This commit fixes a fuzz bug in which the stack was misaligned when
    calling the out-of-fuel builtin function.
    
    The misalignment was introduced by a erroneous handling of the the
    control flow merge introduced by the fuel check conditional. In general,
    prior to every branch emission, a spill to memory is needed to avoid
    issues at the control flow merge.
    
    Note that we don't have many cases like this one in Winch's codebase (3
    in total), however as a follow-up, it's probably worth considering
    introducing a stronger abstraction around branching to ensure that this
    case is handled whenever an arbitrary branch needs to be introduced.
    This change solely focuses on the fix and does not introduce any
    refactoring. I plan to follow-up with investigating a better branching
    strategy, since we would need to introduce a similar pattern for epoch
    handling.
    
    I used `wasm-tools shink` to shrink the original program, which
    I decided to add as part of an integration test.
    saulecabrera committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    4ffcfb6 View commit details
    Browse the repository at this point in the history
  2. Move the test fixture

    saulecabrera committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    b909ae0 View commit details
    Browse the repository at this point in the history