diff options
author | Sam Clegg <sbc@chromium.org> | 2024-05-10 16:33:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-10 23:33:38 +0000 |
commit | abc430b617385f3e989f85e7bd1c2a9d838fd217 (patch) | |
tree | 5a7869083ae64cc59a04cb5512b3f175fade02d5 /src/parser/context-decls.cpp | |
parent | 9975b56614d4a5560b35f009be20d51e360b69dc (diff) | |
download | binaryen-abc430b617385f3e989f85e7bd1c2a9d838fd217.tar.gz binaryen-abc430b617385f3e989f85e7bd1c2a9d838fd217.tar.bz2 binaryen-abc430b617385f3e989f85e7bd1c2a9d838fd217.zip |
[memory64] Add table64 to existing memory64 support (#6577)
Tests is still very limited. Hopefully we can use the upstream spec
tests soon and avoid having to write our own tests for
`.set/.set/.fill/etc`.
See https://github.com/WebAssembly/memory64/issues/51
Diffstat (limited to 'src/parser/context-decls.cpp')
-rw-r--r-- | src/parser/context-decls.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/parser/context-decls.cpp b/src/parser/context-decls.cpp index c78c47d60..c5b212038 100644 --- a/src/parser/context-decls.cpp +++ b/src/parser/context-decls.cpp @@ -82,10 +82,11 @@ Result<> ParseDeclsCtx::addFunc(Name name, Result<Table*> ParseDeclsCtx::addTableDecl(Index pos, Name name, ImportNames* importNames, - Limits limits) { + TableType type) { auto t = std::make_unique<Table>(); - t->initial = limits.initial; - t->max = limits.max ? *limits.max : Table::kUnlimitedSize; + t->indexType = type.indexType; + t->initial = type.limits.initial; + t->max = type.limits.max ? *type.limits.max : Table::kUnlimitedSize; if (name.is()) { if (wasm.getTableOrNull(name)) { // TODO: if the existing table is not explicitly named, fix its name and @@ -105,10 +106,10 @@ Result<Table*> ParseDeclsCtx::addTableDecl(Index pos, Result<> ParseDeclsCtx::addTable(Name name, const std::vector<Name>& exports, ImportNames* import, - Limits limits, + TableType type, Index pos) { CHECK_ERR(checkImport(pos, import)); - auto t = addTableDecl(pos, name, import, limits); + auto t = addTableDecl(pos, name, import, type); CHECK_ERR(t); CHECK_ERR(addExports(in, wasm, *t, exports, ExternalKind::Table)); // TODO: table annotations @@ -138,7 +139,7 @@ Result<Memory*> ParseDeclsCtx::addMemoryDecl(Index pos, ImportNames* importNames, MemType type) { auto m = std::make_unique<Memory>(); - m->indexType = type.type; + m->indexType = type.indexType; m->initial = type.limits.initial; m->max = type.limits.max ? *type.limits.max : Memory::kUnlimitedSize; m->shared = type.shared; |