summaryrefslogtreecommitdiff
path: root/src/binary-reader-linker.cc
diff options
context:
space:
mode:
authorGuy Bedford <guybedford@gmail.com>2017-06-09 19:18:58 +0200
committerSam Clegg <sbc@chromium.org>2017-06-09 10:18:58 -0700
commit754925a7f49ced0be38f908546d82d50b614c92c (patch)
tree8861f3c90e0c92fbbd59e4b42939383d6d0d294e /src/binary-reader-linker.cc
parentcffb9cc41c9e13a020cca57ba2a3b12839aa37f0 (diff)
downloadwabt-754925a7f49ced0be38f908546d82d50b614c92c.tar.gz
wabt-754925a7f49ced0be38f908546d82d50b614c92c.tar.bz2
wabt-754925a7f49ced0be38f908546d82d50b614c92c.zip
Disable memory imports/exports in linker (#486)
Diffstat (limited to 'src/binary-reader-linker.cc')
-rw-r--r--src/binary-reader-linker.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/binary-reader-linker.cc b/src/binary-reader-linker.cc
index cb78f10f..add37f61 100644
--- a/src/binary-reader-linker.cc
+++ b/src/binary-reader-linker.cc
@@ -45,6 +45,11 @@ class BinaryReaderLinker : public BinaryReaderNop {
Index global_index,
Type type,
bool mutable_) override;
+ Result OnImportMemory(Index import_index,
+ StringSlice module_name,
+ StringSlice field_name,
+ Index memory_index,
+ const Limits* page_limits) override;
Result OnFunctionCount(Index count) override;
@@ -154,6 +159,15 @@ Result BinaryReaderLinker::OnImportGlobal(Index import_index,
return Result::Ok;
}
+Result BinaryReaderLinker::OnImportMemory(Index import_index,
+ StringSlice module_name,
+ StringSlice field_name,
+ Index memory_index,
+ const Limits* page_limits) {
+ WABT_FATAL("Linker does not support imported memories");
+ return Result::Error;
+}
+
Result BinaryReaderLinker::OnFunctionCount(Index count) {
binary_->function_count = count;
return Result::Ok;
@@ -243,6 +257,9 @@ Result BinaryReaderLinker::OnExport(Index index,
ExternalKind kind,
Index item_index,
StringSlice name) {
+ if (kind == ExternalKind::Memory) {
+ WABT_FATAL("Linker does not support exported memories");
+ }
binary_->exports.emplace_back();
Export* export_ = &binary_->exports.back();
export_->name = name;