Skip to content

Require memory option if realloc is specified#2505

Merged
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:more-val
Apr 27, 2026
Merged

Require memory option if realloc is specified#2505
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:more-val

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit closes a validation gap between wasm-tools and the upstream specification by ensuring that if the realloc option is specified at all that the memory option is additionally specified. This was discovered recently as a discrepancy with the specification itself, and I split this out to be able to sit down and think a bit more about this change. Specifically I've validated that wit-component cannot produce a component that uses realloc but does not use memory by accident. This means that in practice I'm expecting that this won't cause any accidentally-valid components in use today to stop running. Instead there are unlikely to be any components in the wild that this affects.

Closes #2503

This commit closes a validation gap between `wasm-tools` and the
upstream specification by ensuring that if the `realloc` option is
specified at all that the `memory` option is additionally specified.
This was discovered recently as a discrepancy with the specification
itself, and I split this out to be able to sit down and think a bit more
about this change. Specifically I've validated that `wit-component`
cannot produce a component that uses `realloc` but does not use `memory`
by accident. This means that in practice I'm expecting that this won't
cause any accidentally-valid components in use today to stop running.
Instead there are unlikely to be any components in the wild that this
affects.

Closes bytecodealliance#2503
@alexcrichton alexcrichton requested a review from a team as a code owner April 27, 2026 16:53
@alexcrichton alexcrichton requested review from pchickey and removed request for a team April 27, 2026 16:53
@alexcrichton alexcrichton added this pull request to the merge queue Apr 27, 2026
Merged via the queue into bytecodealliance:main with commit 7478232 Apr 27, 2026
37 checks passed
@alexcrichton alexcrichton deleted the more-val branch April 27, 2026 17:12
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.

Handle memory being None when realloc requires it.

2 participants