summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm-delegations-fields.def1
-rw-r--r--src/wasm/wasm-binary.cpp3
-rw-r--r--src/wasm/wasm-stack.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/wasm-delegations-fields.def b/src/wasm-delegations-fields.def
index cd182e319..e3ec30a40 100644
--- a/src/wasm-delegations-fields.def
+++ b/src/wasm-delegations-fields.def
@@ -620,6 +620,7 @@ switch (DELEGATE_ID) {
}
case Expression::Id::RefCastId: {
DELEGATE_START(RefCast);
+ DELEGATE_FIELD_INT(RefCast, safety);
DELEGATE_FIELD_CHILD(RefCast, ref);
DELEGATE_END(RefCast);
break;
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index cd5763c12..431c39631 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -6935,8 +6935,7 @@ void WasmBinaryBuilder::visitRefAsCast(RefCast* curr, uint32_t code) {
bool WasmBinaryBuilder::maybeVisitRefCast(Expression*& out, uint32_t code) {
if (code == BinaryConsts::RefCastStatic || code == BinaryConsts::RefCast ||
code == BinaryConsts::RefCastNull || code == BinaryConsts::RefCastNop) {
- bool legacy =
- code == BinaryConsts::RefCastStatic || code == BinaryConsts::RefCastNop;
+ bool legacy = code == BinaryConsts::RefCastStatic;
auto heapType = legacy ? getIndexedHeapType() : getHeapType();
auto* ref = popNonVoidExpression();
Nullability nullability;
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index 694ed4269..a2fba3907 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -2036,7 +2036,7 @@ void BinaryInstWriter::visitRefCast(RefCast* curr) {
o << int8_t(BinaryConsts::GCPrefix);
if (curr->safety == RefCast::Unsafe) {
o << U32LEB(BinaryConsts::RefCastNop);
- parent.writeIndexedHeapType(curr->type.getHeapType());
+ parent.writeHeapType(curr->type.getHeapType());
} else {
// TODO: These instructions are deprecated. Remove them.
if (auto type = curr->type.getHeapType();