diff options
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
-rw-r--r-- | src/wasm/wasm-stack.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp index 8afeb6779..8588a049f 100644 --- a/src/wasm/wasm-stack.cpp +++ b/src/wasm/wasm-stack.cpp @@ -2051,7 +2051,11 @@ void BinaryInstWriter::visitRefCast(RefCast* curr) { if (curr->rtt) { o << U32LEB(BinaryConsts::RefCast); } else { - o << U32LEB(BinaryConsts::RefCastStatic); + if (curr->safety == RefCast::Unsafe) { + o << U32LEB(BinaryConsts::RefCastNopStatic); + } else { + o << U32LEB(BinaryConsts::RefCastStatic); + } parent.writeIndexedHeapType(curr->intendedType); } } |