Repository navigation
Make zero-length stream reads/writes more consistent - #755
Merged
Merged
Conversation
alexcrichton
approved these changes
Oct 23, 2026
alexcrichton
left a comment
Collaborator
There was a problem hiding this comment.
Thanks! Before landing this though I'd like to prototype this and see if there's fallout, notably implementing this in Wasmtime and seeing if wit-bindgen's test suite and maybe wasi-libc's passes. I don't find this urgent from my end though, but if someone else wants to see this landed ASAP I can try to prioritize working on that.
Collaborator
|
Ok I've prototyped this in bytecodealliance/wasmtime#15094, and my thoughts of maybe-this-will-break-something stemmed from not realizing that this still had an exemption for streams-with-no-type, so I think this should be good to go 👍 |
lukewagner
force-pushed
the
fix-zero-len
branch
from
October 30, 2026 18:52
0f5244b to
3e01622
Compare
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-bytecodealliance__wasmtime
that referenced
this pull request
Oct 30, 2026
This commit updates to handle WebAssembly/component-model#755 to bounds-check zero-length writes on streams so long as a payload type is present.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes pointer alignment/bounds-checking work the same for zero- and non-zero-length reads/writes, as discussed in #750, and also the temporary same-component-instance check, as discussed in #753. This PR doesn't touch streams empty/unit payloads, which was also discussed in #750, because that raises the new question of what happens if there is no
memory(which is allowed to be omitted).