summaryrefslogtreecommitdiff
path: root/src/binary-reader-ir.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/binary-reader-ir.cc')
-rw-r--r--src/binary-reader-ir.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/binary-reader-ir.cc b/src/binary-reader-ir.cc
index 51b5e2c8..490fea34 100644
--- a/src/binary-reader-ir.cc
+++ b/src/binary-reader-ir.cc
@@ -314,6 +314,10 @@ class BinaryReaderIR : public BinaryReaderNop {
Index index,
std::string_view name) override;
+ Result OnGenericCustomSection(std::string_view name,
+ const void* data,
+ Offset size) override;
+
Result BeginTagSection(Offset size) override { return Result::Ok; }
Result OnTagCount(Index count) override { return Result::Ok; }
Result OnTagType(Index index, Index sig_index) override;
@@ -1750,6 +1754,18 @@ Result BinaryReaderIR::OnTableSymbol(Index index,
return SetTableName(table_index, name);
}
+Result BinaryReaderIR::OnGenericCustomSection(std::string_view name,
+ const void* data,
+ Offset size) {
+ Custom custom = Custom(GetLocation(), name);
+ custom.data.resize(size);
+ if (size > 0) {
+ memcpy(custom.data.data(), data, size);
+ }
+ module_->customs.push_back(std::move(custom));
+ return Result::Ok;
+}
+
} // end anonymous namespace
Result ReadBinaryIr(const char* filename,