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.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index 243b2810b..71bc98928 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -2013,14 +2013,11 @@ void BinaryInstWriter::visitI31Get(I31Get* curr) {
}
void BinaryInstWriter::visitCallRef(CallRef* curr) {
- if (curr->isReturn) {
- assert(curr->target->type != Type::unreachable);
- // TODO: `emitUnreachable` if target has bottom type.
- o << int8_t(BinaryConsts::RetCallRef);
- parent.writeIndexedHeapType(curr->target->type.getHeapType());
- return;
- }
- o << int8_t(BinaryConsts::CallRef);
+ assert(curr->target->type != Type::unreachable);
+ // TODO: `emitUnreachable` if target has bottom type.
+ o << int8_t(curr->isReturn ? BinaryConsts::RetCallRef
+ : BinaryConsts::CallRef);
+ parent.writeIndexedHeapType(curr->target->type.getHeapType());
}
void BinaryInstWriter::visitRefTest(RefTest* curr) {