diff options
Diffstat (limited to 'src/binaryen-c.cpp')
-rw-r--r-- | src/binaryen-c.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp index 0a4b88a2b..6a25790ca 100644 --- a/src/binaryen-c.cpp +++ b/src/binaryen-c.cpp @@ -870,7 +870,7 @@ makeBinaryenCallIndirect(BinaryenModuleRef module, for (BinaryenIndex i = 0; i < numOperands; i++) { ret->operands.push_back((Expression*)operands[i]); } - ret->sig = Signature(Type(params), Type(results)); + ret->heapType = Signature(Type(params), Type(results)); ret->type = Type(results); ret->isReturn = isReturn; ret->finalize(); @@ -1787,24 +1787,28 @@ void BinaryenCallIndirectSetReturn(BinaryenExpressionRef expr, bool isReturn) { BinaryenType BinaryenCallIndirectGetParams(BinaryenExpressionRef expr) { auto* expression = (Expression*)expr; assert(expression->is<CallIndirect>()); - return static_cast<CallIndirect*>(expression)->sig.params.getID(); + return static_cast<CallIndirect*>(expression) + ->heapType.getSignature() + .params.getID(); } void BinaryenCallIndirectSetParams(BinaryenExpressionRef expr, BinaryenType params) { - auto* expression = (Expression*)expr; - assert(expression->is<CallIndirect>()); - static_cast<CallIndirect*>(expression)->sig.params = Type(params); + auto* call = ((Expression*)expr)->cast<CallIndirect>(); + call->heapType = + Signature(Type(params), call->heapType.getSignature().results); } BinaryenType BinaryenCallIndirectGetResults(BinaryenExpressionRef expr) { auto* expression = (Expression*)expr; assert(expression->is<CallIndirect>()); - return static_cast<CallIndirect*>(expression)->sig.results.getID(); + return static_cast<CallIndirect*>(expression) + ->heapType.getSignature() + .results.getID(); } void BinaryenCallIndirectSetResults(BinaryenExpressionRef expr, BinaryenType results) { - auto* expression = (Expression*)expr; - assert(expression->is<CallIndirect>()); - static_cast<CallIndirect*>(expression)->sig.results = Type(results); + auto* call = ((Expression*)expr)->cast<CallIndirect>(); + call->heapType = + Signature(call->heapType.getSignature().params, Type(results)); } // LocalGet BinaryenIndex BinaryenLocalGetGetIndex(BinaryenExpressionRef expr) { |