| Index: src/wasm/ast-decoder.cc
|
| diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc
|
| index 390a67300a34a22640952dc5bc92339d341217f7..b3a8b198f8fe58bd08375b946a3a00c5cf3bf4ea 100644
|
| --- a/src/wasm/ast-decoder.cc
|
| +++ b/src/wasm/ast-decoder.cc
|
| @@ -238,7 +238,7 @@ class WasmDecoder : public Decoder {
|
| return true;
|
| }
|
|
|
| - int OpcodeArity(const byte* pc) {
|
| + unsigned int OpcodeArity(const byte* pc) {
|
| #define DECLARE_ARITY(name, ...) \
|
| static const LocalType kTypes_##name[] = {__VA_ARGS__}; \
|
| static const int kArity_##name = \
|
| @@ -319,7 +319,7 @@ class WasmDecoder : public Decoder {
|
| }
|
| }
|
|
|
| - int OpcodeLength(const byte* pc) {
|
| + unsigned int OpcodeLength(const byte* pc) {
|
| switch (static_cast<WasmOpcode>(*pc)) {
|
| #define DECLARE_OPCODE_CASE(name, opcode, sig) case kExpr##name:
|
| FOREACH_LOAD_MEM_OPCODE(DECLARE_OPCODE_CASE)
|
| @@ -563,7 +563,7 @@ class SR_WasmDecoder : public WasmDecoder {
|
| }
|
| }
|
| // Decode local declarations, if any.
|
| - int length;
|
| + unsigned int length;
|
| uint32_t entries = consume_u32v(&length, "local decls count");
|
| while (entries-- > 0 && pc_ < limit_) {
|
| uint32_t count = consume_u32v(&length, "local count");
|
| @@ -601,7 +601,7 @@ class SR_WasmDecoder : public WasmDecoder {
|
| if (pc_ >= limit_) return; // Nothing to do.
|
|
|
| while (true) { // decoding loop.
|
| - int len = 1;
|
| + unsigned int len = 1;
|
| WasmOpcode opcode = static_cast<WasmOpcode>(*pc_);
|
| TRACE(" @%-6d #%02x:%-20s|", startrel(pc_), opcode,
|
| WasmOpcodes::ShortOpcodeName(opcode));
|
| @@ -1437,7 +1437,7 @@ class SR_WasmDecoder : public WasmDecoder {
|
| // Iteratively process all AST nodes nested inside the loop.
|
| while (pc < limit_) {
|
| WasmOpcode opcode = static_cast<WasmOpcode>(*pc);
|
| - int length = 1;
|
| + unsigned int length = 1;
|
| switch (opcode) {
|
| case kExprLoop:
|
| case kExprIf:
|
| @@ -1515,12 +1515,12 @@ std::ostream& operator<<(std::ostream& os, const Tree& tree) {
|
| return os;
|
| }
|
|
|
| -int OpcodeLength(const byte* pc, const byte* end) {
|
| +unsigned int OpcodeLength(const byte* pc, const byte* end) {
|
| WasmDecoder decoder(nullptr, nullptr, pc, end);
|
| return decoder.OpcodeLength(pc);
|
| }
|
|
|
| -int OpcodeArity(const byte* pc, const byte* end) {
|
| +unsigned int OpcodeArity(const byte* pc, const byte* end) {
|
| WasmDecoder decoder(nullptr, nullptr, pc, end);
|
| return decoder.OpcodeArity(pc);
|
| }
|
| @@ -1564,7 +1564,7 @@ void PrintAst(base::AccountingAllocator* allocator, FunctionBody& body) {
|
| os << "// body: \n";
|
| int control_depth = 0;
|
| while (pc < body.end) {
|
| - size_t length = decoder.OpcodeLength(pc);
|
| + unsigned int length = decoder.OpcodeLength(pc);
|
|
|
| WasmOpcode opcode = static_cast<WasmOpcode>(*pc);
|
| if (opcode == kExprElse) control_depth--;
|
|
|