Skip to content

Further refine behavior of large 1-byte-page memories#12976

Merged
fitzgen merged 1 commit intobytecodealliance:mainfrom
alexcrichton:further-tweak-custom-page-sizes
Apr 6, 2026
Merged

Further refine behavior of large 1-byte-page memories#12976
fitzgen merged 1 commit intobytecodealliance:mainfrom
alexcrichton:further-tweak-custom-page-sizes

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit adjust the behavior of #12884 to return -1 from memory.grow instead of trapping when the growth would exceed the maximal allowable size of memory. This fixes a fuzz-bug which had an unexpected trap and upon further reflection this feels more accurate for what custom-page-sizes can do. With a 1-byte-page memories can grow to 4GiB-2 because that means that -1 always means "growth failed".

This commit adjust the behavior of bytecodealliance#12884 to return -1 from
`memory.grow` instead of trapping when the growth would exceed the
maximal allowable size of memory. This fixes a fuzz-bug which had an
unexpected trap and upon further reflection this feels more accurate for
what custom-page-sizes can do. With a 1-byte-page memories can grow to
4GiB-2 because that means that -1 always means "growth failed".
@alexcrichton alexcrichton requested a review from a team as a code owner April 6, 2026 20:20
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team April 6, 2026 20:20
@alexcrichton alexcrichton added the fuzz-bug Bugs found by a fuzzer label Apr 6, 2026
@fitzgen fitzgen added this pull request to the merge queue Apr 6, 2026
Merged via the queue into bytecodealliance:main with commit 0e320e3 Apr 6, 2026
48 checks passed
@alexcrichton alexcrichton deleted the further-tweak-custom-page-sizes branch April 6, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fuzz-bug Bugs found by a fuzzer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants