summaryrefslogtreecommitdiff
path: root/src/binaryen-c.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/binaryen-c.cpp')
-rw-r--r--src/binaryen-c.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index d7f866663..83c626eb1 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -729,10 +729,12 @@ void BinaryenSetFunctionTable(BinaryenModuleRef module, BinaryenFunctionRef* fun
}
auto* wasm = (Module*)module;
+ Table::Segment segment(wasm->allocator.alloc<Const>()->set(Literal(int32_t(0))));
for (BinaryenIndex i = 0; i < numFuncs; i++) {
- wasm->table.names.push_back(((Function*)funcs[i])->name);
+ segment.data.push_back(((Function*)funcs[i])->name);
}
- wasm->table.initial = wasm->table.max = wasm->table.names.size();
+ wasm->table.segments.push_back(segment);
+ wasm->table.initial = wasm->table.max = numFuncs;
}
// Memory. One per module