alexcrichton opened PR #13577 from alexcrichton:fix-chunked-big-copy to bytecodealliance:main:
This commit fixes a bug in the previous refactorings of
memory.copyor other bulk copy instructions. Notably when fuel/epochs were enabled the operation was chunked up to check fuel between each operation, but the advancement of what to do unconditionally went forwards. When a backwards copy is required this means that data could get corrupted if the src/dst regions are overlapping. The fix here is to setup a separate backwards-copy loop which handles this case so the fuel/epoch-metered copy goes either backwards or forwards depending on what's being copied.<!--
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 ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested cfallin for a review on PR #13577.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #13577.
alexcrichton requested wasmtime-core-reviewers for a review on PR #13577.
:thumbs_up: cfallin submitted PR review:
Thanks!
cfallin added PR #13577 Fix large, backwards, memory.copy with fuel/epochs to the merge queue.
:check: cfallin merged PR #13577.
cfallin removed PR #13577 Fix large, backwards, memory.copy with fuel/epochs from the merge queue.
Last updated: Jul 29 2026 at 05:03 UTC