summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDouglas Crosher <info@jsstats.com>2016-01-16 10:44:23 +1100
committerDouglas Crosher <info@jsstats.com>2016-01-18 08:14:30 +1100
commite96540b5bc824924b3ddefcce4b609781b0f22de (patch)
treee4300035cc5c9b02ebf8b4fa209f851087d5655a /src
parentc01ef410c9c3df8c12504f365e04190935ac2376 (diff)
downloadbinaryen-e96540b5bc824924b3ddefcce4b609781b0f22de.tar.gz
binaryen-e96540b5bc824924b3ddefcce4b609781b0f22de.tar.bz2
binaryen-e96540b5bc824924b3ddefcce4b609781b0f22de.zip
Function section has the flags before the signature index.
Diffstat (limited to 'src')
-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;