diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-01-13 21:00:32 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-01-13 21:00:32 -0800 |
commit | d4f713522f1580b6f2aa7a0716c8ec8df7b48275 (patch) | |
tree | c03deb1c6e14ea0e93de5d1e8006de021547dce2 /src/wasm-binary.h | |
parent | 12bef76986cb6c3b915d811640581faab4977b05 (diff) | |
download | binaryen-d4f713522f1580b6f2aa7a0716c8ec8df7b48275.tar.gz binaryen-d4f713522f1580b6f2aa7a0716c8ec8df7b48275.tar.bz2 binaryen-d4f713522f1580b6f2aa7a0716c8ec8df7b48275.zip |
more binary fixes
Diffstat (limited to 'src/wasm-binary.h')
-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 b87bcc4f2..aaa485a1c 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -443,7 +443,7 @@ public: size_t total = wasm->imports.size() + wasm->functions.size(); o << int8_t(BinaryConsts::Functions) << LEB128(total); for (size_t i = 0; i < total; i++) { - if (debug) std::cerr << "write one at" << pos << std::endl; + if (debug) std::cerr << "write one at" << o.size() << std::endl; Import* import = i < wasm->imports.size() ? wasm->imports[i] : nullptr; Function* function = i >= wasm->imports.size() ? wasm->functions[i - wasm->imports.size()] : nullptr; Name name, type; @@ -470,7 +470,7 @@ public: } if (function) { size_t curr = o.size(); - o << (uint32_t)0; // placeholder + o << (uint16_t)0; // placeholder visit(function->body); size_t size = o.size() - curr; assert(size <= std::numeric_limits<uint16_t>::max()); @@ -1089,10 +1089,10 @@ public: nextLabel = 0; // prepare locals for (size_t i = 0; i < curr->params.size(); i++) { - mappedLocals.push_back(curr[i]); + mappedLocals.push_back(curr->params[i].name); } for (size_t i = 0; i < curr->locals.size(); i++) { - mappedLocals.push_back(curr[i]); + mappedLocals.push_back(curr->locals[i].name); } // process body assert(breakStack.empty()); |