Fix off-by-one in assert_no_overlap boundary check by sumleo · Pull Request #12678 · bytecodealliance/wasmtime
The assert_no_overlap function used strict less-than (<) comparisons to check if two memory regions overlap. This incorrectly rejected adjacent non-overlapping regions where one region's end address equals another region's start address. Changed to less-than-or-equal (<=) to correctly allow adjacent regions. Added comprehensive tests covering separate regions, adjacent regions, mixed types, overlap detection, and edge cases.
alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request
Mar 30, 2026Fixes an off-by-one assertion which is possible to happen when linear memories are directly adjacent to each other. While an esoteric situation, it's technically possible as the added test shows. Closes bytecodealliance#12678
alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request
Mar 30, 2026Fixes an off-by-one assertion which is possible to happen when linear memories are directly adjacent to each other. While an esoteric situation, it's technically possible as the added test shows. Closes bytecodealliance#12678
github-merge-queue bot pushed a commit that referenced this pull request
Mar 31, 2026Fixes an off-by-one assertion which is possible to happen when linear memories are directly adjacent to each other. While an esoteric situation, it's technically possible as the added test shows. Closes #12678
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