From bf110a08e4e717961d811170a49a72212fbf0b96 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 21 Apr 2016 13:46:27 -0700 Subject: support not exporting memory in binaries --- src/wasm-binary.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/wasm-binary.h') diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 8fed9f6d9..ed9b733d0 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -518,7 +518,7 @@ public: auto start = startSection(BinaryConsts::Section::Memory); o << U32LEB(wasm->memory.initial) << U32LEB(wasm->memory.max) - << int8_t(1); // export memory + << int8_t(wasm->memory.exportName.is()); // export memory finishSection(start); } @@ -1343,7 +1343,10 @@ public: if (debug) std::cerr << "== readMemory" << std::endl; wasm.memory.initial = getU32LEB(); wasm.memory.max = getU32LEB(); - verifyInt8(1); // export memory + auto exportMemory = getInt8(); + if (exportMemory) { + wasm.memory.exportName = Name("memory"); + } } void readSignatures() { -- cgit v1.2.3