summaryrefslogtreecommitdiff
path: root/src/wasm-s-parser.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-11-04 15:40:33 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-11-04 15:40:33 -0800
commit2bb4b33e296f999d45b95b2252dfaa11e2ea61b5 (patch)
tree0d3c678fbb726d001633819d0604af47e90819c6 /src/wasm-s-parser.h
parent98719470da218f2cbe2a256e478f56520a29f4dc (diff)
downloadbinaryen-2bb4b33e296f999d45b95b2252dfaa11e2ea61b5.tar.gz
binaryen-2bb4b33e296f999d45b95b2252dfaa11e2ea61b5.tar.bz2
binaryen-2bb4b33e296f999d45b95b2252dfaa11e2ea61b5.zip
memory
Diffstat (limited to 'src/wasm-s-parser.h')
-rw-r--r--src/wasm-s-parser.h14
1 files changed, 13 insertions, 1 deletions
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) {