From d46a737d421d53f68fc13d55fe405cf8c3c5d4c0 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 16 Sep 2016 20:30:09 -0700 Subject: parse empty modules without error --- src/wasm-s-parser.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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) { -- cgit v1.2.3