Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[27.0.0] winch: Sync registers and locals before fuel check (#9564)
* 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. * Move the test fixture
- Loading branch information