Commit 8c8ff95a authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd] Error out if simd opcode is invalid

Bug: chromium:1071711
Bug: v8:10258
Change-Id: Id19add0c7e77ee3b834ff47274b9986cc2aa1f69
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2154767Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67216}
parent 3cef77bc
......@@ -144,7 +144,9 @@ class Decoder {
index = read_u32v<validate>(pc + 1, length, "prefixed opcode index");
// Only support SIMD opcodes that go up to 0xFF (when decoded). Anything
// bigger will need 1 more byte, and the '<< 8' below will be wrong.
DCHECK_LE(index, 0xff);
if (validate && V8_UNLIKELY(index > 0xff)) {
errorf(pc, "Invalid SIMD opcode %d", index);
}
} else {
index = *(pc + 1);
*length = 1;
......
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