diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-01-17 09:54:03 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-01-17 09:54:03 -0800 |
commit | d59d14ffa46bcf9d061a6f3d1e941ac8a70d5bda (patch) | |
tree | c319f1ce3787f9f21ea93ffad293f3b7ac543bce /src/wasm-binary.h | |
parent | 5cbf5020590d61a5d9dbfcc77d7eb7cc144694c7 (diff) | |
parent | 0c78665777e244741bfe6e2ab30fedded96354bd (diff) | |
download | binaryen-d59d14ffa46bcf9d061a6f3d1e941ac8a70d5bda.tar.gz binaryen-d59d14ffa46bcf9d061a6f3d1e941ac8a70d5bda.tar.bz2 binaryen-d59d14ffa46bcf9d061a6f3d1e941ac8a70d5bda.zip |
Merge pull request #116 from JSStats/br-value
The break operation may have a value, and must with the v8 encoding.
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r-- | src/wasm-binary.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 6b2e960d4..0b8663497 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -607,6 +607,11 @@ public: abort(); } if (curr->condition) recurse(curr->condition); + if (curr->value) { + recurse(curr->value); + } else { + o << int8_t(BinaryConsts::Nop); + } } void visitSwitch(Switch *curr) { if (debug) std::cerr << "zz node: Switch" << std::endl; @@ -1267,6 +1272,7 @@ public: auto offset = getInt8(); curr->name = breakStack[breakStack.size() - 1 - offset]; if (code == BinaryConsts::BrIf) readExpression(curr->condition); + readExpression(curr->value); } void visitSwitch(Switch *curr) { if (debug) std::cerr << "zz node: Switch" << std::endl; |