summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/shell-interface.h4
-rw-r--r--src/tools/wasm-shell.cpp11
2 files changed, 15 insertions, 0 deletions
diff --git a/src/shell-interface.h b/src/shell-interface.h
index 8cb7c2672..b9a90131b 100644
--- a/src/shell-interface.h
+++ b/src/shell-interface.h
@@ -122,6 +122,10 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface {
case f64: globals[import->name] = Literal(double(666.6)); break;
default: WASM_UNREACHABLE();
}
+ } else if (import->kind == Import::Memory && import->module == SPECTEST && import->base == MEMORY) {
+ // imported memory has initial 1 and max 2
+ wasm.memory.initial = 1;
+ wasm.memory.max = 2;
}
}
}
diff --git a/src/tools/wasm-shell.cpp b/src/tools/wasm-shell.cpp
index 83d39c9d4..670f5783d 100644
--- a/src/tools/wasm-shell.cpp
+++ b/src/tools/wasm-shell.cpp
@@ -171,6 +171,17 @@ static void run_asserts(Name moduleName, size_t* i, bool* checked, Module* wasm,
break;
}
}
+ for (auto& segment : wasm.table.segments) {
+ for (auto name : segment.data) {
+ // spec tests consider it illegal to use spectest.print in a table
+ if (auto* import = wasm.checkImport(name)) {
+ if (import->module == SPECTEST && import->base == PRINT) {
+ std::cerr << "cannot put spectest.print in table\n";
+ invalid = true;
+ }
+ }
+ }
+ }
}
if (!invalid) {
Colors::red(std::cerr);