Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/test/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 7 additions & 3 deletions src/wasm/wasm-validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading