alexcrichton opened PR #14754 from alexcrichton:fix-eager-bounds-check to bytecodealliance:main:
This commit fixes a too-eager bounds-check for linear memories when they're imported, runtime configuration says memories cannot move, and the minimum size of the memory exceeds the runtime-configured default memory reservation. Imported memories are allowed to be larger than the declared minimum, and the default memory reservation is just a guideline and doesn't prevent memories being created larger than that. Effectively a special-case in bounds-checking just needed and extra clause to ignore imported linear memories because the special-case was inapplicable.
This fixes memory accesses that previously trapped to correctly fall back to a more general bounds check meaning that incorrect traps now succeed as they're supposed to.
Closes #14587
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.mdPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested fitzgen for a review on PR #14754.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #14754.
alexcrichton requested wasmtime-core-reviewers for a review on PR #14754.
:thumbs_up: fitzgen submitted PR review:
Good catch!
fitzgen added PR #14754 Fix a bounds check for imported memories to the merge queue.
:check: fitzgen merged PR #14754.
fitzgen removed PR #14754 Fix a bounds check for imported memories from the merge queue.
Last updated: Oct 31 2026 at 23:03 UTC