summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-binary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r--src/wasm/wasm-binary.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 1de5e4bd1..4e5db69b1 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -3776,12 +3776,13 @@ BinaryConsts::ASTNodes WasmBinaryBuilder::readExpression(Expression*& curr) {
visitMemoryGrow(grow);
break;
}
- case BinaryConsts::CallRef:
+ case BinaryConsts::CallRefUnannotated:
visitCallRef((curr = allocator.alloc<CallRef>())->cast<CallRef>());
break;
+ case BinaryConsts::CallRef:
case BinaryConsts::RetCallRef: {
auto call = allocator.alloc<CallRef>();
- call->isReturn = true;
+ call->isReturn = code == BinaryConsts::RetCallRef;
curr = call;
visitCallRef(call, getTypeByIndex(getU32LEB()));
break;
@@ -6810,11 +6811,7 @@ void WasmBinaryBuilder::visitCallRef(CallRef* curr,
for (size_t i = 0; i < num; i++) {
curr->operands[num - i - 1] = popNonVoidExpression();
}
- if (maybeType) {
- curr->finalize();
- } else {
- curr->finalize(sig.results);
- }
+ curr->finalize(sig.results);
}
bool WasmBinaryBuilder::maybeVisitI31New(Expression*& out, uint32_t code) {