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.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index 3a24d0cc0..6af7279bb 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -1918,18 +1918,20 @@ void BinaryInstWriter::visitCallRef(CallRef* curr) {
void BinaryInstWriter::visitRefTest(RefTest* curr) {
o << int8_t(BinaryConsts::GCPrefix) << U32LEB(BinaryConsts::RefTest);
parent.writeHeapType(curr->ref->type.getHeapType());
- parent.writeHeapType(curr->rtt->type.getHeapType());
+ parent.writeHeapType(curr->getCastType().getHeapType());
}
void BinaryInstWriter::visitRefCast(RefCast* curr) {
o << int8_t(BinaryConsts::GCPrefix) << U32LEB(BinaryConsts::RefCast);
parent.writeHeapType(curr->ref->type.getHeapType());
- parent.writeHeapType(curr->rtt->type.getHeapType());
+ parent.writeHeapType(curr->getCastType().getHeapType());
}
void BinaryInstWriter::visitBrOnCast(BrOnCast* curr) {
- o << int8_t(BinaryConsts::GCPrefix) << U32LEB(BinaryConsts::BrOnCast);
- WASM_UNREACHABLE("TODO (gc): br_on_cast");
+ o << int8_t(BinaryConsts::GCPrefix) << U32LEB(BinaryConsts::BrOnCast)
+ << U32LEB(getBreakIndex(curr->name));
+ parent.writeHeapType(curr->ref->type.getHeapType());
+ parent.writeHeapType(curr->getCastType().getHeapType());
}
void BinaryInstWriter::visitRttCanon(RttCanon* curr) {