summaryrefslogtreecommitdiff
path: root/src/shell-interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shell-interface.h')
-rw-r--r--src/shell-interface.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/shell-interface.h b/src/shell-interface.h
index 96b96cf15..66608c37c 100644
--- a/src/shell-interface.h
+++ b/src/shell-interface.h
@@ -163,7 +163,6 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface {
}
auto& table = it->second;
-
if (index >= table.size()) {
trap("callTable overflow");
}
@@ -233,6 +232,21 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface {
}
}
+ Literal tableLoad(Name tableName, Address addr) override {
+
+ auto it = tables.find(tableName);
+ if (it == tables.end()) {
+ trap("tableGet on non-existing table");
+ }
+
+ auto& table = it->second;
+ if (addr >= table.size()) {
+ trap("tableGet overflow");
+ }
+
+ return table[addr];
+ }
+
bool growMemory(Address /*oldSize*/, Address newSize) override {
// Apply a reasonable limit on memory size, 1GB, to avoid DOS on the
// interpreter.