summaryrefslogtreecommitdiff
path: root/src/s2wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-12-25 11:50:21 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-12-25 18:41:00 -0500
commit23834dd0c7de36cf054db7178619b0755eec9b98 (patch)
tree628235cb7af2036e6e55f8af945e46f6cb74efe7 /src/s2wasm.h
parentf9a5d31370a0e021c3384245f19a2c751afa02ea (diff)
downloadbinaryen-23834dd0c7de36cf054db7178619b0755eec9b98.tar.gz
binaryen-23834dd0c7de36cf054db7178619b0755eec9b98.tar.bz2
binaryen-23834dd0c7de36cf054db7178619b0755eec9b98.zip
fix function indexing in s2wasm
Diffstat (limited to 'src/s2wasm.h')
-rw-r--r--src/s2wasm.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h
index a328218f8..676f0bb2c 100644
--- a/src/s2wasm.h
+++ b/src/s2wasm.h
@@ -985,8 +985,9 @@ private:
void fix() {
auto ensureFunctionIndex = [&](Name name) {
if (functionIndexes.count(name) == 0) {
- functionIndexes[name] = functionIndexes.size();
+ functionIndexes[name] = wasm.table.names.size();
wasm.table.names.push_back(name);
+ if (debug) std::cerr << "function index: " << name << ": " << functionIndexes[name] << '\n';
}
};
for (auto& triple : addressings) {
@@ -1007,7 +1008,6 @@ private:
ensureFunctionIndex(name);
curr->value = Literal(int32_t(functionIndexes[name] + offset));
}
- assert(curr->value.i32 > 0);
curr->type = i32;
}
for (auto& relocation : relocations) {