summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-stack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
-rw-r--r--src/wasm/wasm-stack.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index 95cb4a44c..00b1e5368 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -80,10 +80,11 @@ void BinaryInstWriter::visitCall(Call* curr) {
}
void BinaryInstWriter::visitCallIndirect(CallIndirect* curr) {
+ Index tableIdx = parent.getTableIndex(curr->table);
+
int8_t op =
curr->isReturn ? BinaryConsts::RetCallIndirect : BinaryConsts::CallIndirect;
- o << op << U32LEB(parent.getTypeIndex(curr->sig))
- << U32LEB(0); // Reserved flags field
+ o << op << U32LEB(parent.getTypeIndex(curr->sig)) << U32LEB(tableIdx);
}
void BinaryInstWriter::visitLocalGet(LocalGet* curr) {