diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-20 10:20:29 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-20 10:20:29 -0700 |
commit | fe93b86e0e1dd470c3508fa2ef9f3affbf18b146 (patch) | |
tree | 590786a073f1032aad55b7f018cd258337a7536f /src | |
parent | 41d11f1feb622494aeae9f7dd6a0115972b077e4 (diff) | |
download | binaryen-fe93b86e0e1dd470c3508fa2ef9f3affbf18b146.tar.gz binaryen-fe93b86e0e1dd470c3508fa2ef9f3affbf18b146.tar.bz2 binaryen-fe93b86e0e1dd470c3508fa2ef9f3affbf18b146.zip |
in makeMaybeBlock, alloc a nop if there is nothing
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-s-parser.h | 1 |
1 files changed, 1 insertions, 0 deletions
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<Nop>(); if (s.size() == i+1) return parseExpression(s[i]); auto ret = allocator.alloc<Block>(); for (; i < s.size() && i < stopAt; i++) { |