| Index: src/wasm/ast-decoder.h
|
| diff --git a/src/wasm/ast-decoder.h b/src/wasm/ast-decoder.h
|
| index 9e96053a6ce035773fbe9f992e24d2f0e8430c35..345f488d98e78d27ffc14269e59b789aeb15402b 100644
|
| --- a/src/wasm/ast-decoder.h
|
| +++ b/src/wasm/ast-decoder.h
|
| @@ -25,7 +25,7 @@ namespace wasm {
|
| struct LocalIndexOperand {
|
| uint32_t index;
|
| LocalType type;
|
| - int length;
|
| + unsigned length;
|
|
|
| inline LocalIndexOperand(Decoder* decoder, const byte* pc) {
|
| index = decoder->checked_read_u32v(pc, 1, &length, "local index");
|
| @@ -35,7 +35,7 @@ struct LocalIndexOperand {
|
|
|
| struct ImmI8Operand {
|
| int8_t value;
|
| - int length;
|
| + unsigned length;
|
| inline ImmI8Operand(Decoder* decoder, const byte* pc) {
|
| value = bit_cast<int8_t>(decoder->checked_read_u8(pc, 1, "immi8"));
|
| length = 1;
|
| @@ -44,7 +44,7 @@ struct ImmI8Operand {
|
|
|
| struct ImmI32Operand {
|
| int32_t value;
|
| - int length;
|
| + unsigned length;
|
| inline ImmI32Operand(Decoder* decoder, const byte* pc) {
|
| value = decoder->checked_read_i32v(pc, 1, &length, "immi32");
|
| }
|
| @@ -52,7 +52,7 @@ struct ImmI32Operand {
|
|
|
| struct ImmI64Operand {
|
| int64_t value;
|
| - int length;
|
| + unsigned length;
|
| inline ImmI64Operand(Decoder* decoder, const byte* pc) {
|
| value = decoder->checked_read_i64v(pc, 1, &length, "immi64");
|
| }
|
| @@ -60,7 +60,7 @@ struct ImmI64Operand {
|
|
|
| struct ImmF32Operand {
|
| float value;
|
| - int length;
|
| + unsigned length;
|
| inline ImmF32Operand(Decoder* decoder, const byte* pc) {
|
| value = bit_cast<float>(decoder->checked_read_u32(pc, 1, "immf32"));
|
| length = 4;
|
| @@ -69,7 +69,7 @@ struct ImmF32Operand {
|
|
|
| struct ImmF64Operand {
|
| double value;
|
| - int length;
|
| + unsigned length;
|
| inline ImmF64Operand(Decoder* decoder, const byte* pc) {
|
| value = bit_cast<double>(decoder->checked_read_u64(pc, 1, "immf64"));
|
| length = 8;
|
| @@ -80,7 +80,7 @@ struct GlobalIndexOperand {
|
| uint32_t index;
|
| LocalType type;
|
| MachineType machine_type;
|
| - int length;
|
| + unsigned length;
|
|
|
| inline GlobalIndexOperand(Decoder* decoder, const byte* pc) {
|
| index = decoder->checked_read_u32v(pc, 1, &length, "global index");
|
| @@ -94,10 +94,10 @@ struct BreakDepthOperand {
|
| uint32_t arity;
|
| uint32_t depth;
|
| Control* target;
|
| - int length;
|
| + unsigned length;
|
| inline BreakDepthOperand(Decoder* decoder, const byte* pc) {
|
| - int len1 = 0;
|
| - int len2 = 0;
|
| + unsigned len1 = 0;
|
| + unsigned len2 = 0;
|
| arity = decoder->checked_read_u32v(pc, 1, &len1, "argument count");
|
| depth = decoder->checked_read_u32v(pc, 1 + len1, &len2, "break depth");
|
| length = len1 + len2;
|
| @@ -109,10 +109,10 @@ struct CallIndirectOperand {
|
| uint32_t arity;
|
| uint32_t index;
|
| FunctionSig* sig;
|
| - int length;
|
| + unsigned length;
|
| inline CallIndirectOperand(Decoder* decoder, const byte* pc) {
|
| - int len1 = 0;
|
| - int len2 = 0;
|
| + unsigned len1 = 0;
|
| + unsigned len2 = 0;
|
| arity = decoder->checked_read_u32v(pc, 1, &len1, "argument count");
|
| index = decoder->checked_read_u32v(pc, 1 + len1, &len2, "signature index");
|
| length = len1 + len2;
|
| @@ -124,10 +124,10 @@ struct CallFunctionOperand {
|
| uint32_t arity;
|
| uint32_t index;
|
| FunctionSig* sig;
|
| - int length;
|
| + unsigned length;
|
| inline CallFunctionOperand(Decoder* decoder, const byte* pc) {
|
| - int len1 = 0;
|
| - int len2 = 0;
|
| + unsigned len1 = 0;
|
| + unsigned len2 = 0;
|
| arity = decoder->checked_read_u32v(pc, 1, &len1, "argument count");
|
| index = decoder->checked_read_u32v(pc, 1 + len1, &len2, "function index");
|
| length = len1 + len2;
|
| @@ -139,10 +139,10 @@ struct CallImportOperand {
|
| uint32_t arity;
|
| uint32_t index;
|
| FunctionSig* sig;
|
| - int length;
|
| + unsigned length;
|
| inline CallImportOperand(Decoder* decoder, const byte* pc) {
|
| - int len1 = 0;
|
| - int len2 = 0;
|
| + unsigned len1 = 0;
|
| + unsigned len2 = 0;
|
| arity = decoder->checked_read_u32v(pc, 1, &len1, "argument count");
|
| index = decoder->checked_read_u32v(pc, 1 + len1, &len2, "import index");
|
| length = len1 + len2;
|
| @@ -154,10 +154,10 @@ struct BranchTableOperand {
|
| uint32_t arity;
|
| uint32_t table_count;
|
| const byte* table;
|
| - int length;
|
| + unsigned length;
|
| inline BranchTableOperand(Decoder* decoder, const byte* pc) {
|
| - int len1 = 0;
|
| - int len2 = 0;
|
| + unsigned len1 = 0;
|
| + unsigned len2 = 0;
|
| arity = decoder->checked_read_u32v(pc, 1, &len1, "argument count");
|
| table_count =
|
| decoder->checked_read_u32v(pc, 1 + len1, &len2, "table count");
|
| @@ -180,12 +180,12 @@ struct BranchTableOperand {
|
| struct MemoryAccessOperand {
|
| uint32_t alignment;
|
| uint32_t offset;
|
| - int length;
|
| + unsigned length;
|
| inline MemoryAccessOperand(Decoder* decoder, const byte* pc) {
|
| - int alignment_length;
|
| + unsigned alignment_length;
|
| alignment =
|
| decoder->checked_read_u32v(pc, 1, &alignment_length, "alignment");
|
| - int offset_length;
|
| + unsigned offset_length;
|
| offset = decoder->checked_read_u32v(pc, 1 + alignment_length,
|
| &offset_length, "offset");
|
| length = alignment_length + offset_length;
|
| @@ -194,7 +194,7 @@ struct MemoryAccessOperand {
|
|
|
| struct ReturnArityOperand {
|
| uint32_t arity;
|
| - int length;
|
| + unsigned length;
|
|
|
| inline ReturnArityOperand(Decoder* decoder, const byte* pc) {
|
| arity = decoder->checked_read_u32v(pc, 1, &length, "return count");
|
| @@ -262,10 +262,10 @@ BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals,
|
| const byte* start, const byte* end);
|
|
|
| // Computes the length of the opcode at the given address.
|
| -int OpcodeLength(const byte* pc, const byte* end);
|
| +unsigned OpcodeLength(const byte* pc, const byte* end);
|
|
|
| // Computes the arity (number of sub-nodes) of the opcode at the given address.
|
| -int OpcodeArity(const byte* pc, const byte* end);
|
| +unsigned OpcodeArity(const byte* pc, const byte* end);
|
|
|
| } // namespace wasm
|
| } // namespace internal
|
|
|