[wasm] Avoid accessing vector after its end
When checking whether to merge a region with its surrounding regions in {InsertIntoWritableRegions}, we did not check first whether the determined {insert_pos} is within the vector. We were thus accessing (reading) after the end of the vector. The bug only happened on MSVC builds, suggesting that clang deterministically read a value which is never equal to the end of the new region, whereas for MSVC it sometimes happened that we read exactly the {region.end()} value, and we tried to merge regions. R=jkummerow@chromium.org Bug: v8:12643 Change-Id: If30d910ed6e996f7b0e1d8c5b439c3d842a498f6 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3487988Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/main@{#79283}
Showing
Please
register
or
sign in
to comment