summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-01-18 09:40:40 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-01-18 09:40:40 -0800
commitcef2b2b2e3431d2735c30fae3796a8dceb614a8d (patch)
tree0e69dd86ac3e999df3fca92301ff9559cc06737c /src/wasm-binary.h
parent0bfc82d51f2b781cd7640cee783c86a23845c5b9 (diff)
parente96540b5bc824924b3ddefcce4b609781b0f22de (diff)
downloadbinaryen-cef2b2b2e3431d2735c30fae3796a8dceb614a8d.tar.gz
binaryen-cef2b2b2e3431d2735c30fae3796a8dceb614a8d.tar.bz2
binaryen-cef2b2b2e3431d2735c30fae3796a8dceb614a8d.zip
Merge pull request #113 from JSStats/func-sig-order
Function section has the flags before the signature index.
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index b6b0a55ae..d720c9a79 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -456,11 +456,11 @@ public:
type = function->type;
}
if (debug) std::cerr << "writing" << name << std::endl;
- o << getFunctionTypeIndex(type);
o << int8_t(BinaryConsts::Named |
(BinaryConsts::Import * !!import) |
(BinaryConsts::Locals * (function && function->locals.size() > 0)) |
(BinaryConsts::Export * (wasm->exportsMap.count(name) > 0)));
+ o << getFunctionTypeIndex(type);
emitString(name.str);
if (function && function->locals.size() > 0) {
mapLocals(function);
@@ -1040,8 +1040,8 @@ public:
size_t total = getLEB128(); // imports and functions
for (size_t i = 0; i < total; i++) {
if (debug) std::cerr << "read one at " << pos << std::endl;
- auto type = wasm.functionTypes[getInt16()];
auto data = getInt8();
+ auto type = wasm.functionTypes[getInt16()];
bool named = data & BinaryConsts::Named;
assert(named);
bool import = data & BinaryConsts::Import;