summaryrefslogtreecommitdiff
path: root/src/binary-writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/binary-writer.cc')
-rw-r--r--src/binary-writer.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/binary-writer.cc b/src/binary-writer.cc
index b6c33ccc..be117869 100644
--- a/src/binary-writer.cc
+++ b/src/binary-writer.cc
@@ -566,6 +566,7 @@ void BinaryWriter::WriteExpr(const Func* func, const Expr* expr) {
case ExprType::MemoryCopy:
WriteOpcode(stream_, Opcode::MemoryCopy);
WriteU32Leb128(stream_, 0, "memory.copy reserved");
+ WriteU32Leb128(stream_, 0, "memory.copy reserved");
break;
case ExprType::MemoryDrop: {
Index index =
@@ -586,8 +587,8 @@ void BinaryWriter::WriteExpr(const Func* func, const Expr* expr) {
Index index =
module_->GetDataSegmentIndex(cast<MemoryInitExpr>(expr)->var);
WriteOpcode(stream_, Opcode::MemoryInit);
- WriteU32Leb128(stream_, 0, "memory.init reserved");
WriteU32Leb128(stream_, index, "memory.init segment");
+ WriteU32Leb128(stream_, 0, "memory.init reserved");
break;
}
case ExprType::MemorySize:
@@ -597,6 +598,7 @@ void BinaryWriter::WriteExpr(const Func* func, const Expr* expr) {
case ExprType::TableCopy:
WriteOpcode(stream_, Opcode::TableCopy);
WriteU32Leb128(stream_, 0, "table.copy reserved");
+ WriteU32Leb128(stream_, 0, "table.copy reserved");
break;
case ExprType::TableDrop: {
Index index =
@@ -609,8 +611,8 @@ void BinaryWriter::WriteExpr(const Func* func, const Expr* expr) {
Index index =
module_->GetElemSegmentIndex(cast<TableInitExpr>(expr)->var);
WriteOpcode(stream_, Opcode::TableInit);
- WriteU32Leb128(stream_, 0, "table.init reserved");
WriteU32Leb128(stream_, index, "table.init segment");
+ WriteU32Leb128(stream_, 0, "table.init reserved");
break;
}
case ExprType::Nop: