Fix checking of prefixed memory ops in fuzzer

In https://crrev.com/c/2084321 I added s128 load store to the fuzzer,
and updated the memop generator to use IsPrefixOpcode check. But it was
used wrongly. IsPrefixOpcode checks a 1 byte opcode and see if it is a
prefix opcode, but if memory_op is already a 2 byte opcode, it will fail
the IsPrefixOpcode check.

Bug: chromium:1059899
Change-Id: I4caadfb2feaf42ebb9f5578cb790ef8a1d08d173
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2095681
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66638}
This commit is contained in:
Ng Zhi An 2020-03-09 13:52:40 -07:00 committed by Commit Bot
parent a99a9b2731
commit d86f8ea50a

View File

@ -282,7 +282,7 @@ class WasmGenerator {
// Generate the index and the arguments, if any.
Generate<kWasmI32, arg_types...>(data);
if (WasmOpcodes::IsPrefixOpcode(memory_op)) {
if (WasmOpcodes::IsPrefixOpcode(static_cast<WasmOpcode>(memory_op >> 8))) {
DCHECK(memory_op >> 8 == kAtomicPrefix || memory_op >> 8 == kSimdPrefix);
builder_->EmitWithPrefix(memory_op);
} else {