From fe93b86e0e1dd470c3508fa2ef9f3affbf18b146 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 20 May 2016 10:20:29 -0700 Subject: in makeMaybeBlock, alloc a nop if there is nothing --- 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 7cada23af..dae321866 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -1031,6 +1031,7 @@ private: } Expression* makeMaybeBlock(Element& s, size_t i, size_t stopAt=-1) { + if (s.size() == i) return allocator.alloc(); if (s.size() == i+1) return parseExpression(s[i]); auto ret = allocator.alloc(); for (; i < s.size() && i < stopAt; i++) { -- cgit v1.2.3