From a3d940ff8020ad8adb525b4ab018fcd86d08c54a Mon Sep 17 00:00:00 2001
From: Sam Clegg <sbc@chromium.org>
Date: Thu, 7 Nov 2024 15:53:01 -0800
Subject: Rename indexType -> addressType. NFC (#7060)

See https://github.com/WebAssembly/memory64/pull/92
---
 src/wasm/wasm-binary.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'src/wasm/wasm-binary.cpp')

diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 173a89163..7e1daf0b1 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -2246,7 +2246,7 @@ void WasmBinaryReader::readMemories() {
     getResizableLimits(memory->initial,
                        memory->max,
                        memory->shared,
-                       memory->indexType,
+                       memory->addressType,
                        Memory::kUnlimitedSize);
     wasm.addMemory(std::move(memory));
   }
@@ -2491,7 +2491,7 @@ Memory* WasmBinaryReader::getMemory(Index index) {
 void WasmBinaryReader::getResizableLimits(Address& initial,
                                           Address& max,
                                           bool& shared,
-                                          Type& indexType,
+                                          Type& addressType,
                                           Address defaultIfNoMax) {
   auto flags = getU32LEB();
   bool hasMax = (flags & BinaryConsts::HasMaximum) != 0;
@@ -2502,7 +2502,7 @@ void WasmBinaryReader::getResizableLimits(Address& initial,
     throwError("shared memory must have max size");
   }
   shared = isShared;
-  indexType = is64 ? Type::i64 : Type::i32;
+  addressType = is64 ? Type::i64 : Type::i32;
   if (hasMax) {
     max = is64 ? getU64LEB() : getU32LEB();
   } else {
@@ -2552,7 +2552,7 @@ void WasmBinaryReader::readImports() {
         getResizableLimits(table->initial,
                            table->max,
                            is_shared,
-                           table->indexType,
+                           table->addressType,
                            Table::kUnlimitedSize);
         if (is_shared) {
           throwError("Tables may not be shared");
@@ -2568,7 +2568,7 @@ void WasmBinaryReader::readImports() {
         getResizableLimits(memory->initial,
                            memory->max,
                            memory->shared,
-                           memory->indexType,
+                           memory->addressType,
                            Memory::kUnlimitedSize);
         wasm.addMemory(std::move(memory));
         break;
@@ -3393,7 +3393,7 @@ void WasmBinaryReader::readTableDeclarations() {
     getResizableLimits(table->initial,
                        table->max,
                        is_shared,
-                       table->indexType,
+                       table->addressType,
                        Table::kUnlimitedSize);
     if (is_shared) {
       throwError("Tables may not be shared");
@@ -4706,7 +4706,7 @@ Index WasmBinaryReader::readMemoryAccess(Address& alignment, Address& offset) {
     throwError("Memory index out of range while reading memory alignment.");
   }
   auto* memory = wasm.memories[memIdx].get();
-  offset = memory->indexType == Type::i32 ? getU32LEB() : getU64LEB();
+  offset = memory->addressType == Type::i32 ? getU32LEB() : getU64LEB();
 
   return memIdx;
 }
-- 
cgit v1.2.3