[wasm] Fix some lost WasmDecoder template parameters.

R=clemensh@chromium.org

Change-Id: I6539bef4a0caa01bffaad85332c31681176c24d6
Reviewed-on: https://chromium-review.googlesource.com/1204110
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55607}
This commit is contained in:
Michael Starzinger 2018-09-04 13:33:03 +02:00 committed by Commit Bot
parent 0e78acebda
commit 7623d0fa4c

View File

@ -783,7 +783,7 @@ class WasmDecoder : public Decoder {
break;
case kExprSetLocal: // fallthru
case kExprTeeLocal: {
LocalIndexImmediate<Decoder::kValidate> imm(decoder, pc);
LocalIndexImmediate<validate> imm(decoder, pc);
if (assigned->length() > 0 &&
imm.index < static_cast<uint32_t>(assigned->length())) {
// Unverified code might have an out-of-bounds index.
@ -813,8 +813,7 @@ class WasmDecoder : public Decoder {
return VALIDATE(decoder->ok()) ? assigned : nullptr;
}
inline bool Validate(const byte* pc,
LocalIndexImmediate<Decoder::kValidate>& imm) {
inline bool Validate(const byte* pc, LocalIndexImmediate<validate>& imm) {
if (!VALIDATE(imm.index < total_locals())) {
errorf(pc + 1, "invalid local index: %u", imm.index);
return false;
@ -1041,7 +1040,7 @@ class WasmDecoder : public Decoder {
case kExprSetLocal:
case kExprTeeLocal:
case kExprGetLocal: {
LocalIndexImmediate<Decoder::kValidate> imm(decoder, pc);
LocalIndexImmediate<validate> imm(decoder, pc);
return 1 + imm.length;
}
case kExprBrTable: {
@ -1473,7 +1472,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
}
case kExprThrow: {
CHECK_PROTOTYPE_OPCODE(eh);
ExceptionIndexImmediate<Decoder::kValidate> imm(this, this->pc_);
ExceptionIndexImmediate<validate> imm(this, this->pc_);
len = 1 + imm.length;
if (!this->Validate(this->pc_, imm)) break;
PopArgs(imm.exception->ToFunctionSig());
@ -1497,7 +1496,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
case kExprCatch: {
// TODO(kschimpf): Fix to use type signature of exception.
CHECK_PROTOTYPE_OPCODE(eh);
ExceptionIndexImmediate<Decoder::kValidate> imm(this, this->pc_);
ExceptionIndexImmediate<validate> imm(this, this->pc_);
len = 1 + imm.length;
if (!this->Validate(this->pc_, imm)) break;
@ -1749,7 +1748,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
break;
}
case kExprGetLocal: {
LocalIndexImmediate<Decoder::kValidate> imm(this, this->pc_);
LocalIndexImmediate<validate> imm(this, this->pc_);
if (!this->Validate(this->pc_, imm)) break;
auto* value = Push(imm.type);
CALL_INTERFACE_IF_REACHABLE(GetLocal, value, imm);
@ -1757,7 +1756,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
break;
}
case kExprSetLocal: {
LocalIndexImmediate<Decoder::kValidate> imm(this, this->pc_);
LocalIndexImmediate<validate> imm(this, this->pc_);
if (!this->Validate(this->pc_, imm)) break;
auto value = Pop(0, local_type_vec_[imm.index]);
CALL_INTERFACE_IF_REACHABLE(SetLocal, value, imm);
@ -1765,7 +1764,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
break;
}
case kExprTeeLocal: {
LocalIndexImmediate<Decoder::kValidate> imm(this, this->pc_);
LocalIndexImmediate<validate> imm(this, this->pc_);
if (!this->Validate(this->pc_, imm)) break;
auto value = Pop(0, local_type_vec_[imm.index]);
auto* result = Push(value.type);