diff --git a/scripts/test/shared.py b/scripts/test/shared.py index c96257e743f..25e3cc00e11 100644 --- a/scripts/test/shared.py +++ b/scripts/test/shared.py @@ -450,7 +450,7 @@ def get_tests(test_dir, extensions=[], recursive=False): # Requires correct handling of tag imports from different instances of the same module, # ref.null wast constants, and splitting for module instances 'instance.wast', - 'table64.wast', # Requires validations for table size + # 'table64.wast', # Requires validations for table size 'table_grow.wast', # Incorrect table linking semantics in interpreter 'tag.wast', # Non-empty tag results allowed by stack switching 'try_table.wast', # Requires try_table interpretation @@ -460,7 +460,7 @@ def get_tests(test_dir, extensions=[], recursive=False): 'ref_null.wast', # Requires ref.null wast constants 'return_call_indirect.wast', # Requires more precise unreachable validation 'select.wast', # Requires ref.null wast constants - 'table.wast', # Requires support for table default elements + # 'table.wast', # Requires support for table default elements 'unreached-invalid.wast', # Requires more precise unreachable validation 'array.wast', # Requires support for table default elements 'br_if.wast', # Requires more precise branch validation diff --git a/src/wasm.h b/src/wasm.h index 605c7025395..2d20265295d 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -2419,9 +2419,9 @@ class ElementSegment : public Named { class Table : public Importable { public: static const Address::address32_t kPageSize = 1; - static const Index kUnlimitedSize = Index(-1); + static const uint64_t kUnlimitedSize = -1ull; // In wasm32/64, the maximum table size is limited by a 32-bit pointer: 4GB - static const Index kMaxSize = Index(-1); + static const Index kMaxSize = Index(-1ull); Address initial = 0; Address max = kMaxSize; diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 0a1df50dbb9..379ea1382a3 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -4595,9 +4595,13 @@ static void validateTables(Module& module, ValidationInfo& info) { auto funcref = Type(HeapType::func, Nullable); for (auto& table : module.tables) { - info.shouldBeTrue(table->initial <= table->max, - "table", - "size minimum must not be greater than maximum"); + // info.shouldBeTrue(table->initial != 0 || table->initial <= table->max, + info.shouldBeTrue( + table->initial <= table->max, + "table", + (std::string("size minimum must not be greater than maximum ") + + std::to_string(table->initial) + " " + std::to_string(table->max)) + .c_str()); info.shouldBeTrue( table->type.isNullable(), "table",