diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-04-21 21:26:32 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-04-22 10:12:24 -0700 |
commit | 0a43823615155f956f078ce7b7a8a580bc01fbe1 (patch) | |
tree | 741d1b423ea3f8f9430c96559df13524c970f7d1 /src | |
parent | a35db41bcca092212328b6be2fa0eddb635f2f3f (diff) | |
download | binaryen-0a43823615155f956f078ce7b7a8a580bc01fbe1.tar.gz binaryen-0a43823615155f956f078ce7b7a8a580bc01fbe1.tar.bz2 binaryen-0a43823615155f956f078ce7b7a8a580bc01fbe1.zip |
br_table offsets are int32s, not lebs
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-binary.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 1e54a7607..159dd24fa 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -861,9 +861,9 @@ public: recurse(curr->condition); o << int8_t(BinaryConsts::TableSwitch) << U32LEB(curr->targets.size()); for (auto target : curr->targets) { - o << U32LEB(getBreakIndex(target)); + o << uint32_t(getBreakIndex(target)); } - o << U32LEB(getBreakIndex(curr->default_)); + o << uint32_t(getBreakIndex(curr->default_)); } void visitCall(Call *curr) { if (debug) std::cerr << "zz node: Call" << std::endl; @@ -1742,9 +1742,9 @@ public: curr->value = popExpression(); auto numTargets = getU32LEB(); for (size_t i = 0; i < numTargets; i++) { - curr->targets.push_back(getBreakName(getU32LEB())); + curr->targets.push_back(getBreakName(getInt32())); } - curr->default_ = getBreakName(getU32LEB()); + curr->default_ = getBreakName(getInt32()); } void visitCall(Call *curr) { if (debug) std::cerr << "zz node: Call" << std::endl; |