summaryrefslogtreecommitdiff
path: root/src/passes/ReorderFunctions.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-08-15 14:29:57 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-08-15 15:03:36 -0700
commit113efcaa1e814304662ccc56312d8c59014a3a6c (patch)
tree5639a4a9d834947c9fc190e5916b9961e545cfba /src/passes/ReorderFunctions.cpp
parent086c4c0f89bbe626f4c98ae95716084db0541b0d (diff)
downloadbinaryen-113efcaa1e814304662ccc56312d8c59014a3a6c.tar.gz
binaryen-113efcaa1e814304662ccc56312d8c59014a3a6c.tar.bz2
binaryen-113efcaa1e814304662ccc56312d8c59014a3a6c.zip
offset support in table
Diffstat (limited to 'src/passes/ReorderFunctions.cpp')
-rw-r--r--src/passes/ReorderFunctions.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/passes/ReorderFunctions.cpp b/src/passes/ReorderFunctions.cpp
index 38ef98afb..679fedb61 100644
--- a/src/passes/ReorderFunctions.cpp
+++ b/src/passes/ReorderFunctions.cpp
@@ -38,8 +38,10 @@ struct ReorderFunctions : public WalkerPass<PostWalker<ReorderFunctions, Visitor
for (auto& curr : module->exports) {
counts[curr->value]++;
}
- for (auto& curr : module->table.names) {
- counts[curr]++;
+ for (auto& segment : module->table.segments) {
+ for (auto& curr : segment.data) {
+ counts[curr]++;
+ }
}
std::sort(module->functions.begin(), module->functions.end(), [this](
const std::unique_ptr<Function>& a,