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.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index ff8fae06e..39a6d0149 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -538,10 +538,14 @@ RelooperBlockRef RelooperAddBlockWithSwitch(RelooperRef relooper, BinaryenExpres
return RelooperRef(ret);
}
-void RelooperAddBranchForSwitch(RelooperBlockRef from, RelooperBlockRef to, BinaryenIndex index, BinaryenExpressionRef code) {
+void RelooperAddBranchForSwitch(RelooperBlockRef from, RelooperBlockRef to, BinaryenIndex* indexes, BinaryenIndex numIndexes, BinaryenExpressionRef code) {
auto* fromBlock = (CFG::Block*)from;
auto* toBlock = (CFG::Block*)to;
- fromBlock->AddBranchTo(toBlock, (wasm::Index)index, (Expression*)code);
+ std::vector<Index> values;
+ for (Index i = 0; i < numIndexes; i++) {
+ values.push_back(indexes[i]);
+ }
+ fromBlock->AddSwitchBranchTo(toBlock, std::move(values), (Expression*)code);
}
BinaryenExpressionRef RelooperRenderAndDispose(RelooperRef relooper, RelooperBlockRef entry, BinaryenIndex labelHelper, BinaryenModuleRef module) {