From 113efcaa1e814304662ccc56312d8c59014a3a6c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 15 Aug 2016 14:29:57 -0700 Subject: offset support in table --- src/binaryen-c.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/binaryen-c.cpp') 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()->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 -- cgit v1.2.3