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.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index cca351b6f..2e4e9d332 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -1908,7 +1908,13 @@ void BinaryInstWriter::visitRttSub(RttSub* curr) {
}
void BinaryInstWriter::visitStructNew(StructNew* curr) {
- WASM_UNREACHABLE("TODO (gc): struct.new");
+ o << int8_t(BinaryConsts::GCPrefix);
+ if (curr->isWithDefault()) {
+ o << U32LEB(BinaryConsts::StructNewDefaultWithRtt);
+ } else {
+ o << U32LEB(BinaryConsts::StructNewWithRtt);
+ }
+ parent.writeHeapType(curr->rtt->type.getHeapType());
}
void BinaryInstWriter::visitStructGet(StructGet* curr) {