Commit 25cca476 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

Fix validation check for shuffle immediates

Off-by-one error - valid shuffle values are [0..31] (inclusive).

Bug: chromium:1092013
Change-Id: Ic9edd79acb148fd2061869a1765b9a50e38403ae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2239754Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68307}
parent 00215f30
......@@ -1294,7 +1294,7 @@ class WasmDecoder : public Decoder {
max_lane = std::max(max_lane, imm.shuffle[i]);
}
// Shuffle indices must be in [0..31] for a 16 lane shuffle.
if (!VALIDATE(max_lane <= 2 * kSimd128Size)) {
if (!VALIDATE(max_lane < 2 * kSimd128Size)) {
error(pc_ + 2, "invalid shuffle mask");
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment