summaryrefslogtreecommitdiff
path: root/src/wasm-binary-writer.c
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2016-10-24 13:44:13 -0700
committerBen Smith <binji@chromium.org>2016-10-26 10:16:25 -0700
commitc034df96ff86d5731e3eff0f71bb2d96f7a37305 (patch)
treef1fda5beb9711bb94b6ed8760cf36daaeade8d67 /src/wasm-binary-writer.c
parent4ec57d83d7869c3f96922debbe0b1e637d1fa2f8 (diff)
downloadwabt-c034df96ff86d5731e3eff0f71bb2d96f7a37305.tar.gz
wabt-c034df96ff86d5731e3eff0f71bb2d96f7a37305.tar.bz2
wabt-c034df96ff86d5731e3eff0f71bb2d96f7a37305.zip
Add reserved immediate to three operators
call_indirect, grow_memory and current_memory all take an additional immediate which must be zero. After the MVP, this will be used to allow specifying a table or memory index.
Diffstat (limited to 'src/wasm-binary-writer.c')
-rw-r--r--src/wasm-binary-writer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wasm-binary-writer.c b/src/wasm-binary-writer.c
index c24fc5b7..12a21322 100644
--- a/src/wasm-binary-writer.c
+++ b/src/wasm-binary-writer.c
@@ -378,6 +378,7 @@ static void write_expr(Context* ctx,
assert(index >= 0 && (size_t)index < module->func_types.size);
write_opcode(&ctx->stream, WASM_OPCODE_CALL_INDIRECT);
write_u32_leb128(&ctx->stream, index, "signature index");
+ write_u32_leb128(&ctx->stream, 0, "call_indirect reserved");
break;
}
case WASM_EXPR_TYPE_COMPARE:
@@ -413,6 +414,7 @@ static void write_expr(Context* ctx,
break;
case WASM_EXPR_TYPE_CURRENT_MEMORY:
write_opcode(&ctx->stream, WASM_OPCODE_CURRENT_MEMORY);
+ write_u32_leb128(&ctx->stream, 0, "current_memory reserved");
break;
case WASM_EXPR_TYPE_DROP:
write_opcode(&ctx->stream, WASM_OPCODE_DROP);
@@ -431,6 +433,7 @@ static void write_expr(Context* ctx,
}
case WASM_EXPR_TYPE_GROW_MEMORY:
write_opcode(&ctx->stream, WASM_OPCODE_GROW_MEMORY);
+ write_u32_leb128(&ctx->stream, 0, "grow_memory reserved");
break;
case WASM_EXPR_TYPE_IF: {
WasmLabelNode node;