summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-09-16 20:30:09 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-09-16 20:30:09 -0700
commitd46a737d421d53f68fc13d55fe405cf8c3c5d4c0 (patch)
tree2a37e6c7d885703af835ac3570cbd65bbc52cb95 /src
parent4ebe1f0c41c3d9311853b79f2cbeb4ec5b4b886c (diff)
downloadbinaryen-d46a737d421d53f68fc13d55fe405cf8c3c5d4c0.tar.gz
binaryen-d46a737d421d53f68fc13d55fe405cf8c3c5d4c0.tar.bz2
binaryen-d46a737d421d53f68fc13d55fe405cf8c3c5d4c0.zip
parse empty modules without error
Diffstat (limited to 'src')
-rw-r--r--src/wasm-s-parser.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index 75d6fed1d..f244a08f9 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -274,6 +274,7 @@ public:
// Assumes control of and modifies the input.
SExpressionWasmBuilder(Module& wasm, Element& module, Name* moduleName = nullptr) : wasm(wasm), allocator(wasm.allocator), importCounter(0), globalCounter(0) {
assert(module[0]->str() == MODULE);
+ if (module.size() == 1) return;
Index i = 1;
if (module[i]->dollared()) {
if (moduleName) {