dicej opened PR #14630 from dicej:bail-bug-backports-50.0.x to bytecodealliance:release-50.0.0:
Route more component adapters to the host (#14574)
Prior to this commit adapters were fully compiled inline for sync<->sync
adapters, but only if the lift/lowers were sync. This was incorrect when
the intermediate function type wasasync, however, in a number of
ways. This bug led to a number ofbail_bug!s and incorrect execution
when using the FACT-compiled adapter. The fix in this commit is to route
async-typed adapted functions through the host like other async items.
This additionally refactors things internally with less duplication,
for examplesync_startandasync_startare nowstart_call, and the
various cases in the trampoline compiler are consolidated into one.This changes preexisting behavior of one test, with the comment of the
test adjusted from explaining the prior behavior to explaining the
current behavior.save and restore
next_switch_itemfor sync-to-sync
callsWe were doing this correctly for other types of calls, but somehow never thought
of or tested for sync-to-sync calls :facepalm:.Since we're not switching fibers in this case, we need to use a
Vecas a stack
instead of the call stack, which is slightly annoying, but not a big deal.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.mdPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
dicej requested alexcrichton for a review on PR #14630.
:thumbs_up: alexcrichton submitted PR review.
github-actions[bot] added the label wasmtime:api on PR #14630.
:check: alexcrichton merged PR #14630.
Last updated: Oct 11 2026 at 04:10 UTC