Stream: git-wasmtime

Topic: wasmtime / PR #10730 winch: Consolidate branch emission


view this post on Zulip Wasmtime GitHub notifications bot (May 05 2025 at 19:59):

saulecabrera opened PR #10730 from saulecabrera:winch-br_table-stack-handling to bytecodealliance:main:

This commit fixes https://github.com/bytecodealliance/wasmtime/issues/10613

When emitting some WebAssembly instructions involving branches, like br_if stack pointer expectations must be met at jump sites, more importantly when these instructions deal with multiple branches or fall-through cases, the need to reclaim any extra stack space might arise, and when it does, special handling is needed to ensure that value location is respected. Prior to this change, the emission for br_table was incorrectly handling multiple return values on the stack, causing the miscompilation reported in the issue above.

This commit introduces a better mechanism to deal with branch emission, ensuring that all the invariants are applied to the main entry points for branches: return, br , br_if and br_table.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (May 05 2025 at 19:59):

saulecabrera requested wasmtime-compiler-reviewers for a review on PR #10730.

view this post on Zulip Wasmtime GitHub notifications bot (May 05 2025 at 19:59):

saulecabrera requested abrown for a review on PR #10730.

view this post on Zulip Wasmtime GitHub notifications bot (May 05 2025 at 19:59):

saulecabrera requested alexcrichton for a review on PR #10730.

view this post on Zulip Wasmtime GitHub notifications bot (May 05 2025 at 19:59):

saulecabrera requested wasmtime-core-reviewers for a review on PR #10730.

view this post on Zulip Wasmtime GitHub notifications bot (May 05 2025 at 20:02):

saulecabrera updated PR #10730.

view this post on Zulip Wasmtime GitHub notifications bot (May 05 2025 at 20:19):

saulecabrera updated PR #10730.

view this post on Zulip Wasmtime GitHub notifications bot (May 05 2025 at 20:51):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 05 2025 at 21:15):

alexcrichton merged PR #10730.


Last updated: Dec 06 2025 at 06:05 UTC