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.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index db40a5980..911447b48 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -2033,15 +2033,14 @@ void BinaryInstWriter::visitRefCast(RefCast* curr) {
o << int8_t(BinaryConsts::GCPrefix);
if (curr->safety == RefCast::Unsafe) {
o << U32LEB(BinaryConsts::RefCastNop);
- parent.writeIndexedHeapType(curr->intendedType);
+ parent.writeIndexedHeapType(curr->type.getHeapType());
} else {
- // Emulate legacy polymorphic behavior for now.
- if (curr->ref->type.isNullable()) {
+ if (curr->type.isNullable()) {
o << U32LEB(BinaryConsts::RefCastNull);
} else {
o << U32LEB(BinaryConsts::RefCast);
}
- parent.writeHeapType(curr->intendedType);
+ parent.writeHeapType(curr->type.getHeapType());
}
}