From 2bb4b33e296f999d45b95b2252dfaa11e2ea61b5 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 4 Nov 2015 15:40:33 -0800 Subject: memory --- src/wasm-s-parser.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/wasm-s-parser.h') diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index fbcf9fcbc..415936c0b 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -20,6 +20,7 @@ IString MODULE("module"), PARAM("param"), RESULT("result"), MEMORY("memory"), + SEGMENT("segment"), EXPORT("export"), IMPORT("import"), TABLE("table"), @@ -611,7 +612,18 @@ private: } void parseMemory(Element& s) { - wasm.memorySize = atoi(s[1]->c_str()); + wasm.memory.initial = atoi(s[1]->c_str()); + if (s.size() == 2) return; + size_t i = 2; + if (s[i]->isStr()) { + wasm.memory.max = atoi(s[i]->c_str()); + i++; + } + while (i < s.size()) { + Element& curr = *s[i]; + assert(curr[0]->str() == SEGMENT); + + } } void parseExport(Element& s) { -- cgit v1.2.3