diff options
Diffstat (limited to 'deps/v8/src/wasm/function-body-decoder.cc')
-rw-r--r-- | deps/v8/src/wasm/function-body-decoder.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/deps/v8/src/wasm/function-body-decoder.cc b/deps/v8/src/wasm/function-body-decoder.cc index c1e8e541b5..0568d61f3f 100644 --- a/deps/v8/src/wasm/function-body-decoder.cc +++ b/deps/v8/src/wasm/function-body-decoder.cc @@ -45,7 +45,7 @@ BytecodeIterator::BytecodeIterator(const byte* start, const byte* end, DecodeResult VerifyWasmCode(AccountingAllocator* allocator, const WasmFeatures& enabled, const WasmModule* module, WasmFeatures* detected, - FunctionBody& body) { + const FunctionBody& body) { Zone zone(allocator, ZONE_NAME); WasmFullDecoder<Decoder::kValidate, EmptyInterface> decoder( &zone, module, enabled, detected, body); @@ -151,7 +151,12 @@ bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body, unsigned length = WasmDecoder<Decoder::kNoValidate>::OpcodeLength(&decoder, i.pc()); + unsigned offset = 1; WasmOpcode opcode = i.current(); + if (WasmOpcodes::IsPrefixOpcode(opcode)) { + opcode = i.prefixed_opcode(); + offset = 2; + } if (line_numbers) line_numbers->push_back(i.position()); if (opcode == kExprElse || opcode == kExprCatch) { control_depth--; @@ -188,7 +193,7 @@ bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body, } #undef CASE_LOCAL_TYPE } else { - for (unsigned j = 1; j < length; ++j) { + for (unsigned j = offset; j < length; ++j) { os << " 0x" << AsHex(i.pc()[j], 2) << ","; } } |