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

wasmtime: Consume fuel on all return paths #8837

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Jun 18, 2024

  1. wasmtime: Consume fuel on all return paths

    As far as I can tell, when functions use a `return` instruction rather
    than falling off the end, fuel was not being tracked correctly. The
    `fuel_function_exit` method was only called from
    `after_translate_function`, which is only called once all the
    instructions in the function have been translated, not at each return.
    
    In this commit I switched to calling `fuel_function_exit` from
    `handle_before_return` instead, alongside some of the `wmemcheck` hooks.
    That should ensure that it happens on every function exit, regardless of
    what form that exit takes.
    
    I think `after_translate_function` is fundamentally difficult to use
    correctly, and it wasn't used for anything else, so I've also removed it
    in this commit. And I did a minor cleanup at the site of one of the
    calls to `handle_before_return` while I was looking at it.
    jameysharp committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    5bc82b4 View commit details
    Browse the repository at this point in the history