Skip to content

Make zero-length stream reads/writes more consistent - #755

Merged
lukewagner merged 1 commit into
mainfrom
fix-zero-len
Oct 30, 2026
Merged

lukewagner merged 1 commit into
mainfrom
fix-zero-len

Conversation

@lukewagner

@lukewagner lukewagner commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

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).

@alexcrichton alexcrichton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alexcrichton

Copy link
Copy Markdown
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
lukewagner merged commit 36b9b95 into main Oct 30, 2026
2 checks passed
@lukewagner
lukewagner deleted the fix-zero-len branch October 30, 2026 18:53
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants