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.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index c1d4f1222..f1aaff93e 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -68,7 +68,9 @@ void BinaryInstWriter::visitCall(Call* curr) {
void BinaryInstWriter::visitCallIndirect(CallIndirect* curr) {
int8_t op =
curr->isReturn ? BinaryConsts::RetCallIndirect : BinaryConsts::CallIndirect;
- o << op << U32LEB(parent.getFunctionTypeIndex(curr->fullType))
+ auto* type = parent.getModule()->getFunctionType(curr->fullType);
+ Signature sig(Type(type->params), type->result);
+ o << op << U32LEB(parent.getTypeIndex(sig))
<< U32LEB(0); // Reserved flags field
}