diff options
author | Sam Clegg <sbc@chromium.org> | 2021-10-18 11:54:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-18 11:54:59 -0700 |
commit | 61be173f4b4754cf6e46408a6fd21e175fc8eb7c (patch) | |
tree | 49728637adcda20550279cd6390613501ccefeb4 /src | |
parent | 669d32b09920c41bec6a4524c0f2c371483ad12c (diff) | |
download | wabt-61be173f4b4754cf6e46408a6fd21e175fc8eb7c.tar.gz wabt-61be173f4b4754cf6e46408a6fd21e175fc8eb7c.tar.bz2 wabt-61be173f4b4754cf6e46408a6fd21e175fc8eb7c.zip |
Update testsuite (#1738)
bulk-memory-operations and reference-types were completely
removed from the upstream testsuite becuase there were
merged into the upstream spec:
https://github.com/WebAssembly/testsuite/pull/44
In order to land this I had to disable several spec tests
under wasm2c because it lacks support for mutli-table and
reference types. I filed #1737 to track this.
Diffstat (limited to 'src')
-rw-r--r-- | src/c-writer.cc | 3 | ||||
-rw-r--r-- | src/interp/interp.cc | 6 | ||||
-rw-r--r-- | src/type-checker.cc | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/c-writer.cc b/src/c-writer.cc index 2c3eb429..df8c037b 100644 --- a/src/c-writer.cc +++ b/src/c-writer.cc @@ -1100,6 +1100,9 @@ void CWriter::WriteElemInitializers() { } Index elem_segment_index = 0; for (const ElemSegment* elem_segment : module_->elem_segments) { + if (elem_segment->kind == SegmentKind::Passive) { + continue; + } Write("offset = "); WriteInitExpr(elem_segment->offset); Write(";", Newline()); diff --git a/src/interp/interp.cc b/src/interp/interp.cc index 05a40bd4..e5daa6fe 100644 --- a/src/interp/interp.cc +++ b/src/interp/interp.cc @@ -456,6 +456,9 @@ Result Table::Grow(Store& store, u32 count, Ref ref) { u32 new_size; if (store.HasValueType(ref, type_.element) && CanGrow<u32>(type_.limits, old_size, count, &new_size)) { + // Grow the limits of the table too, so that if it is used as an + // import to another module its new size is honored. + type_.limits.initial += count; elements_.resize(new_size); Fill(store, old_size, ref, new_size - old_size); return Result::Ok; @@ -529,6 +532,9 @@ Result Memory::Match(class Store& store, Result Memory::Grow(u64 count) { u64 new_pages; if (CanGrow<u64>(type_.limits, pages_, count, &new_pages)) { + // Grow the limits of the memory too, so that if it is used as an + // import to another module its new size is honored. + type_.limits.initial += count; #if WABT_BIG_ENDIAN auto old_size = data_.size(); #endif diff --git a/src/type-checker.cc b/src/type-checker.cc index 3e875a31..9453dee2 100644 --- a/src/type-checker.cc +++ b/src/type-checker.cc @@ -492,7 +492,7 @@ Result TypeChecker::OnCallIndirect(const TypeVector& param_types, Result TypeChecker::OnFuncRef(Index* out_index) { Type type; Result result = PeekType(0, &type); - if (!type.IsIndex()) { + if (!(type == Type::Any || type.IsIndex())) { TypeVector actual; if (Succeeded(result)) { actual.push_back(type); @@ -766,7 +766,7 @@ Result TypeChecker::OnRefNullExpr(Type type) { Result TypeChecker::OnRefIsNullExpr() { Type type; Result result = PeekType(0, &type); - if (!type.IsRef()) { + if (!(type == Type::Any || type.IsRef())) { TypeVector actual; if (Succeeded(result)) { actual.push_back(type); |