Require memory option if realloc is specified#2505
Merged
alexcrichton merged 1 commit intobytecodealliance:mainfrom Apr 27, 2026
Merged
Require memory option if realloc is specified#2505alexcrichton merged 1 commit intobytecodealliance:mainfrom
memory option if realloc is specified#2505alexcrichton merged 1 commit intobytecodealliance:mainfrom
Conversation
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
pchickey
approved these changes
Apr 27, 2026
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 commit closes a validation gap between
wasm-toolsand the upstream specification by ensuring that if thereallocoption is specified at all that thememoryoption 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 thatwit-componentcannot produce a component that usesreallocbut does not usememoryby 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