diff options
63 files changed, 1590 insertions, 1658 deletions
diff --git a/src/sexpr-wasm.c b/src/sexpr-wasm.c index be3c920f..f57cc7df 100644 --- a/src/sexpr-wasm.c +++ b/src/sexpr-wasm.c @@ -182,7 +182,9 @@ int main(int argc, char** argv) { result |= wasm_check_script(&parser.script); if (result == WASM_OK) { - WasmBinaryWriter writer; + WasmBinaryWriter writer = {}; + if (s_verbose) + writer.log_writes = 1; result |= wasm_write_binary(&writer, &parser.script); } } diff --git a/src/wasm-binary-writer.c b/src/wasm-binary-writer.c index 760b4ee7..49c5c8cc 100644 --- a/src/wasm-binary-writer.c +++ b/src/wasm-binary-writer.c @@ -243,6 +243,11 @@ static uint8_t s_binary_opcodes[] = { WASM_OPCODE_I64_XOR, }; +static uint8_t s_cast_opcodes[] = { + WASM_OPCODE_F32_REINTERPRET_I32, WASM_OPCODE_F64_REINTERPRET_I64, + WASM_OPCODE_I32_REINTERPRET_F32, WASM_OPCODE_I64_REINTERPRET_F64, +}; + static uint8_t s_compare_opcodes[] = { WASM_OPCODE_F32_EQ, WASM_OPCODE_F32_GE, WASM_OPCODE_F32_GT, WASM_OPCODE_F32_LE, WASM_OPCODE_F32_LT, WASM_OPCODE_F32_NE, @@ -311,10 +316,17 @@ static uint8_t s_unary_opcodes[] = { WASM_OPCODE_I64_POPCNT, }; +typedef struct WasmLabelNode { + WasmLabel* label; + int depth; + struct WasmLabelNode* next; +} WasmLabelNode; + typedef struct WasmWriteContext { WasmBinaryWriter* writer; size_t offset; - int verbose; + WasmLabelNode* top_label; + int max_depth; int* import_sig_indexes; int* func_sig_indexes; @@ -387,7 +399,7 @@ static void dump_memory(const void* start, } static void print_header(WasmWriteContext* ctx, const char* name, int index) { - if (1 || ctx->verbose) + if (ctx->writer->log_writes) printf("; %s %d\n", name, index); } @@ -474,6 +486,11 @@ static uint8_t binary_opcode(WasmBinaryOp* op) { return s_binary_opcodes[op->op_type]; } +static uint8_t cast_opcode(WasmCastOp* op) { + assert(op->op_type >= 0 && op->op_type < ARRAY_SIZE(s_cast_opcodes)); + return s_cast_opcodes[op->op_type]; +} + static uint8_t compare_opcode(WasmCompareOp* op) { assert(op->op_type >= 0 && op->op_type < ARRAY_SIZE(s_compare_opcodes)); return s_compare_opcodes[op->op_type]; @@ -494,6 +511,64 @@ static uint8_t unary_opcode(WasmUnaryOp* op) { return s_unary_opcodes[op->op_type]; } +/* TODO(binji): share with wasm-check.c */ +static int string_slices_are_equal(WasmStringSlice* a, WasmStringSlice* b) { + return a->start && b->start && a->length == b->length && + memcmp(a->start, b->start, a->length) == 0; +} + +/* TODO(binji): share with wasm-check.c */ +static WasmLabelNode* find_label_by_name(WasmLabelNode* top_label, + WasmStringSlice* name) { + WasmLabelNode* node = top_label; + while (node) { + if (node->label && string_slices_are_equal(node->label, name)) + return node; + node = node->next; + } +} + +/* TODO(binji): share with wasm-check.c */ +static WasmLabelNode* find_label_by_var(WasmLabelNode* top_label, + WasmVar* var) { + if (var->type == WASM_VAR_TYPE_NAME) + return find_label_by_name(top_label, &var->name); + + WasmLabelNode* node = top_label; + int i = 0; + while (node && i != var->index) { + node = node->next; + i++; + } + return node; +} + +typedef enum WasmForceLabel { + WASM_NO_FORCE_LABEL, + WASM_FORCE_LABEL, +} WasmForceLabel; + +/* TODO(binji): share with wasm-check.c */ +static void push_label(WasmWriteContext* ctx, + WasmLabelNode* node, + WasmLabel* label, + WasmForceLabel force_label) { + if (label->start || force_label) { + node->label = label; + node->next = ctx->top_label; + node->depth = ctx->max_depth; + ctx->top_label = node; + } + ctx->max_depth++; +} + +/* TODO(binji): share with wasm-check.c */ +static void pop_label(WasmWriteContext* ctx, WasmLabel* label) { + ctx->max_depth--; + if (ctx->top_label && ctx->top_label->label == label) + ctx->top_label = ctx->top_label->next; +} + static int find_func_signature(WasmFuncSignatureVector* sigs, WasmType result_type, WasmTypeVector* param_types) { @@ -525,6 +600,7 @@ static void get_func_signatures(WasmWriteContext* ctx, WasmFuncType* func_type = module->func_types.data[i]; WasmFuncSignature* sig = wasm_append_func_signature(sigs); sig->result_type = func_type->sig.result_type; + memset(&sig->param_types, 0, sizeof(sig->param_types)); wasm_extend_types(&sig->param_types, &func_type->sig.param_types); } @@ -540,6 +616,7 @@ static void get_func_signatures(WasmWriteContext* ctx, index = sigs->size; WasmFuncSignature* sig = wasm_append_func_signature(sigs); sig->result_type = import->func_sig.result_type; + memset(&sig->param_types, 0, sizeof(sig->param_types)); wasm_extend_types(&sig->param_types, &import->func_sig.param_types); } } else { @@ -560,22 +637,23 @@ static void get_func_signatures(WasmWriteContext* ctx, for (i = 0; i < module->funcs.size; ++i) { WasmFunc* func = module->funcs.data[i]; int index; - if (func->flags & WASM_FUNC_FLAG_HAS_SIGNATURE) { + if (func->flags & WASM_FUNC_FLAG_HAS_FUNC_TYPE) { + WasmFuncType* func_type = + wasm_get_func_type_by_var(module, &func->type_var); + assert(func_type); + index = find_func_signature(sigs, func_type->sig.result_type, + &func_type->sig.param_types); + assert(index != -1); + } else { + assert(func->flags & WASM_FUNC_FLAG_HAS_SIGNATURE); index = find_func_signature(sigs, func->result_type, &func->params.types); if (index == -1) { index = sigs->size; WasmFuncSignature* sig = wasm_append_func_signature(sigs); sig->result_type = func->result_type; + memset(&sig->param_types, 0, sizeof(sig->param_types)); wasm_extend_types(&sig->param_types, &func->params.types); } - } else { - assert(func->flags & WASM_FUNC_FLAG_HAS_FUNC_TYPE); - WasmFuncType* func_type = - wasm_get_func_type_by_var(module, &func->type_var); - assert(func_type); - index = find_func_signature(sigs, func_type->sig.result_type, - &func_type->sig.param_types); - assert(index != -1); } ctx->func_sig_indexes[i] = index; @@ -583,32 +661,55 @@ static void get_func_signatures(WasmWriteContext* ctx, } static void remap_locals(WasmWriteContext* ctx, WasmFunc* func) { + int num_params = func->params.types.size; + int num_locals = func->locals.types.size; ctx->remapped_locals = - realloc(ctx->remapped_locals, func->locals.types.size * sizeof(int)); + realloc(ctx->remapped_locals, (num_params + num_locals) * sizeof(int)); int max[WASM_NUM_V8_TYPES] = {}; int i; - for (i = 0; i < func->locals.types.size; ++i) { + for (i = 0; i < num_locals; ++i) { WasmType type = func->locals.types.data[i]; max[wasm_type_to_v8_type(type)]++; } - /* Args don't need remapping */ - for (i = 0; i < func->params.types.size; ++i) + /* params don't need remapping */ + for (i = 0; i < num_params; ++i) ctx->remapped_locals[i] = i; int start[WASM_NUM_V8_TYPES]; - start[WASM_TYPE_V8_I32] = func->params.types.size; + start[WASM_TYPE_V8_I32] = num_params; start[WASM_TYPE_V8_I64] = start[WASM_TYPE_V8_I32] + max[WASM_TYPE_V8_I32]; start[WASM_TYPE_V8_F32] = start[WASM_TYPE_V8_I64] + max[WASM_TYPE_V8_I64]; start[WASM_TYPE_V8_F64] = start[WASM_TYPE_V8_F32] + max[WASM_TYPE_V8_F32]; int seen[WASM_NUM_V8_TYPES] = {}; - for (i = 0; i < func->locals.types.size; ++i) { + for (i = 0; i < num_locals; ++i) { WasmType type = func->locals.types.data[i]; WasmTypeV8 v8_type = wasm_type_to_v8_type(type); - ctx->remapped_locals[i] = start[v8_type] + seen[v8_type]++; + ctx->remapped_locals[num_params + i] = start[v8_type] + seen[v8_type]++; + } +} + +static WasmResult write_tableswitch_target(WasmWriteContext* ctx, + WasmBindingVector* case_bindings, + WasmCaseVector* cases, + WasmTarget* target) { + switch (target->type) { + case WASM_TARGET_TYPE_CASE: { + int index = wasm_get_index_from_var(case_bindings, &target->var); + assert(index >= 0 && index < cases->size); + out_u16(ctx, index, "case index"); + break; + } + + case WASM_TARGET_TYPE_BR: { + WasmLabelNode* node = find_label_by_var(ctx->top_label, &target->var); + out_u16(ctx, 0x8000 | (ctx->max_depth - node->depth - 1), "br depth"); + break; + } } + return WASM_OK; } static WasmResult write_expr_list(WasmWriteContext* ctx, @@ -627,22 +728,67 @@ static WasmResult write_expr(WasmWriteContext* ctx, result |= write_expr(ctx, module, func, expr->binary.left); result |= write_expr(ctx, module, func, expr->binary.right); break; - case WASM_EXPR_TYPE_BLOCK: + case WASM_EXPR_TYPE_BLOCK: { + WasmLabelNode node; + push_label(ctx, &node, &expr->block.label, WASM_NO_FORCE_LABEL); out_opcode(ctx, WASM_OPCODE_BLOCK); out_u8(ctx, expr->block.exprs.size, "num expressions"); result |= write_expr_list(ctx, module, func, &expr->block.exprs); + pop_label(ctx, &expr->block.label); break; - case WASM_EXPR_TYPE_BR: + } + case WASM_EXPR_TYPE_BR: { + WasmLabelNode* node = find_label_by_var(ctx->top_label, &expr->br.var); + assert(node); + out_opcode(ctx, WASM_OPCODE_BR); + out_u8(ctx, ctx->max_depth - node->depth - 1, "break depth"); + if (expr->br.expr) + result |= write_expr(ctx, module, func, expr->br.expr); + else + out_opcode(ctx, WASM_OPCODE_NOP); break; - case WASM_EXPR_TYPE_BR_IF: + } + case WASM_EXPR_TYPE_BR_IF: { + WasmLabelNode* node = find_label_by_var(ctx->top_label, &expr->br_if.var); + assert(node); + out_opcode(ctx, WASM_OPCODE_BR_IF); + out_u8(ctx, ctx->max_depth - node->depth - 1, "break depth"); + result |= write_expr(ctx, module, func, expr->br_if.cond); + /* TODO(binji): support br_if expression */ + out_opcode(ctx, WASM_OPCODE_NOP); break; - case WASM_EXPR_TYPE_CALL: + } + case WASM_EXPR_TYPE_CALL: { + int index = wasm_get_func_index_by_var(module, &expr->call.var); + assert(index >= 0 && index < module->funcs.size); + out_opcode(ctx, WASM_OPCODE_CALL_FUNCTION); + /* defined functions are always after all imports */ + out_leb128(ctx, module->imports.size + index, "func index"); + result |= write_expr_list(ctx, module, func, &expr->call.args); break; - case WASM_EXPR_TYPE_CALL_IMPORT: + } + case WASM_EXPR_TYPE_CALL_IMPORT: { + int index = wasm_get_import_index_by_var(module, &expr->call.var); + assert(index >= 0 && index < module->imports.size); + out_opcode(ctx, WASM_OPCODE_CALL_FUNCTION); + /* imports are always first */ + out_leb128(ctx, index, "import index"); + result |= write_expr_list(ctx, module, func, &expr->call.args); break; - case WASM_EXPR_TYPE_CALL_INDIRECT: + } + case WASM_EXPR_TYPE_CALL_INDIRECT: { + int index = + wasm_get_func_type_index_by_var(module, &expr->call_indirect.var); + assert(index >= 0 && index < module->func_types.size); + out_opcode(ctx, WASM_OPCODE_CALL_INDIRECT); + out_leb128(ctx, index, "signature index"); + result |= write_expr(ctx, module, func, expr->call_indirect.expr); + result |= write_expr_list(ctx, module, func, &expr->call_indirect.args); break; + } case WASM_EXPR_TYPE_CAST: + out_opcode(ctx, cast_opcode(&expr->cast.op)); + result |= write_expr(ctx, module, func, expr->cast.expr); break; case WASM_EXPR_TYPE_COMPARE: out_opcode(ctx, compare_opcode(&expr->compare.op)); @@ -683,11 +829,21 @@ static WasmResult write_expr(WasmWriteContext* ctx, out_opcode(ctx, convert_opcode(&expr->convert.op)); result |= write_expr(ctx, module, func, expr->convert.expr); break; - case WASM_EXPR_TYPE_GET_LOCAL: + case WASM_EXPR_TYPE_GET_LOCAL: { + int index = wasm_get_local_index_by_var(func, &expr->get_local.var); + assert(index >= 0 && index < func->params_and_locals.types.size); + out_opcode(ctx, WASM_OPCODE_GET_LOCAL); + out_leb128(ctx, ctx->remapped_locals[index], "remapped local index"); break; + } case WASM_EXPR_TYPE_GROW_MEMORY: + out_opcode(ctx, WASM_OPCODE_RESIZE_MEM_L); + result |= write_expr(ctx, module, func, expr->grow_memory.expr); break; case WASM_EXPR_TYPE_HAS_FEATURE: + /* TODO(binji): add when supported by v8-native */ + out_u8(ctx, WASM_OPCODE_I8_CONST, "has_feature not supported"); + out_u8(ctx, 0, ""); break; case WASM_EXPR_TYPE_IF: out_opcode(ctx, WASM_OPCODE_IF); @@ -700,23 +856,50 @@ static WasmResult write_expr(WasmWriteContext* ctx, result |= write_expr(ctx, module, func, expr->if_else.true_); result |= write_expr(ctx, module, func, expr->if_else.false_); break; - case WASM_EXPR_TYPE_LABEL: + case WASM_EXPR_TYPE_LABEL: { + WasmLabelNode node; + push_label(ctx, &node, &expr->label.label, WASM_FORCE_LABEL); out_opcode(ctx, WASM_OPCODE_BLOCK); out_u8(ctx, 1, "num expressions"); result |= write_expr(ctx, module, func, expr->label.expr); + pop_label(ctx, &expr->label.label); break; + } case WASM_EXPR_TYPE_LOAD: + case WASM_EXPR_TYPE_LOAD_EXTEND: { + /* Access byte: 0bAaao0000 + A = Alignment. If set, access is unaligned + a = Atomicity. 0 = None, 1 = SeqCst, 2 = Acq, 3 = Rel + o = Offset. If set, offset field follows access byte */ + /* TODO(binji): support alignment */ out_opcode(ctx, mem_opcode(&expr->load.op)); + uint8_t access = 0; + if (expr->load.offset) + access |= 0x10; + out_u8(ctx, access, "load access byte"); + if (expr->load.offset) + out_leb128(ctx, (uint32_t)expr->load.offset, "load offset"); result |= write_expr(ctx, module, func, expr->load.addr); break; - case WASM_EXPR_TYPE_LOAD_EXTEND: - break; - case WASM_EXPR_TYPE_LOAD_GLOBAL: + } + case WASM_EXPR_TYPE_LOAD_GLOBAL: { + out_opcode(ctx, WASM_OPCODE_LOAD_GLOBAL); + int index = wasm_get_global_index_by_var(module, &expr->load_global.var); + out_leb128(ctx, index, "global index"); break; - case WASM_EXPR_TYPE_LOOP: + } + case WASM_EXPR_TYPE_LOOP: { + WasmLabelNode outer; + WasmLabelNode inner; + push_label(ctx, &outer, &expr->loop.outer, WASM_NO_FORCE_LABEL); + push_label(ctx, &inner, &expr->loop.inner, WASM_FORCE_LABEL); out_opcode(ctx, WASM_OPCODE_LOOP); - result |= write_expr(ctx, module, func, expr->label.expr); + out_u8(ctx, expr->loop.exprs.size, "num expressions"); + result |= write_expr_list(ctx, module, func, &expr->loop.exprs); + pop_label(ctx, &expr->loop.inner); + pop_label(ctx, &expr->loop.outer); break; + } case WASM_EXPR_TYPE_MEMORY_SIZE: out_opcode(ctx, WASM_OPCODE_MEMORY_SIZE); break; @@ -731,17 +914,73 @@ static WasmResult write_expr(WasmWriteContext* ctx, result |= write_expr(ctx, module, func, expr->return_.expr); break; case WASM_EXPR_TYPE_SELECT: + out_opcode(ctx, WASM_OPCODE_SELECT); + result |= write_expr(ctx, module, func, expr->select.cond); + result |= write_expr(ctx, module, func, expr->select.true_); + result |= write_expr(ctx, module, func, expr->select.false_); break; - case WASM_EXPR_TYPE_SET_LOCAL: + case WASM_EXPR_TYPE_SET_LOCAL: { + int index = wasm_get_local_index_by_var(func, &expr->get_local.var); + out_opcode(ctx, WASM_OPCODE_SET_LOCAL); + out_leb128(ctx, ctx->remapped_locals[index], "remapped local index"); + result |= write_expr(ctx, module, func, expr->set_local.expr); break; + } case WASM_EXPR_TYPE_STORE: + case WASM_EXPR_TYPE_STORE_WRAP: { + /* See LOAD for format of memory access byte */ + out_opcode(ctx, mem_opcode(&expr->store.op)); + uint8_t access = 0; + if (expr->store.offset) + access |= 0x10; + out_u8(ctx, access, "store access byte"); + if (expr->store.offset) + out_leb128(ctx, (uint32_t)expr->store.offset, "store offset"); + result |= write_expr(ctx, module, func, expr->store.addr); + result |= write_expr(ctx, module, func, expr->store.value); break; - case WASM_EXPR_TYPE_STORE_GLOBAL: - break; - case WASM_EXPR_TYPE_STORE_WRAP: + } + case WASM_EXPR_TYPE_STORE_GLOBAL: { + out_opcode(ctx, WASM_OPCODE_STORE_GLOBAL); + int index = wasm_get_global_index_by_var(module, &expr->load_global.var); + out_leb128(ctx, index, "global index"); + result |= write_expr(ctx, module, func, expr->store_global.expr); break; - case WASM_EXPR_TYPE_TABLESWITCH: + } + case WASM_EXPR_TYPE_TABLESWITCH: { + WasmLabelNode node; + out_opcode(ctx, WASM_OPCODE_TABLESWITCH); + out_u16(ctx, expr->tableswitch.targets.size + 1, "num targets"); + out_u16(ctx, expr->tableswitch.cases.size, "num cases"); + int i; + for (i = 0; i < expr->tableswitch.targets.size; ++i) { + WasmTarget* target = &expr->tableswitch.targets.data[i]; + result |= + write_tableswitch_target(ctx, &expr->tableswitch.case_bindings, + &expr->tableswitch.cases, target); + } + result |= write_tableswitch_target(ctx, &expr->tableswitch.case_bindings, + &expr->tableswitch.cases, + &expr->tableswitch.default_target); + push_label(ctx, &node, &expr->tableswitch.label, WASM_NO_FORCE_LABEL); + result |= write_expr(ctx, module, func, expr->tableswitch.expr); + for (i = 0; i < expr->tableswitch.cases.size; ++i) { + WasmCase* case_ = &expr->tableswitch.cases.data[i]; + if (case_->exprs.size) { + if (case_->exprs.size > 1) { + out_opcode(ctx, WASM_OPCODE_BLOCK); + out_u8(ctx, case_->exprs.size, "num expressions"); + result |= write_expr_list(ctx, module, func, &case_->exprs); + } else { + result |= write_expr(ctx, module, func, case_->exprs.data[0]); + } + } else { + out_u8(ctx, WASM_OPCODE_NOP, "WASM_OPCODE_NOP for fallthrough"); + } + } + pop_label(ctx, &expr->tableswitch.label); break; + } case WASM_EXPR_TYPE_UNARY: out_opcode(ctx, unary_opcode(&expr->unary.op)); result |= write_expr(ctx, module, func, expr->unary.expr); @@ -774,6 +1013,7 @@ static WasmResult write_module(WasmWriteContext* ctx, WasmModule* module) { WasmResult result = WASM_OK; int i; + ctx->offset = 0; size_t segments_offset; if (module->memory) { out_u8(ctx, WASM_SECTION_MEMORY, "WASM_SECTION_MEMORY"); @@ -856,6 +1096,8 @@ static WasmResult write_module(WasmWriteContext* ctx, WasmModule* module) { WasmFunc* func = module->funcs.data[i]; print_header(ctx, "function", i); ctx->func_offsets[i] = ctx->offset; + remap_locals(ctx, func); + int is_exported = wasm_func_is_exported(module, func); /* TODO(binji): remove? */ int has_name = 1; /* is_exported */ @@ -872,7 +1114,6 @@ static WasmResult write_module(WasmWriteContext* ctx, WasmModule* module) { if (has_name) out_u32(ctx, 0, "func name offset"); if (has_locals) { - remap_locals(ctx, func); int num_locals[WASM_NUM_V8_TYPES] = {}; int j; for (j = 0; j < func->locals.types.size; ++j) @@ -926,7 +1167,8 @@ static WasmResult write_module(WasmWriteContext* ctx, WasmModule* module) { WasmImport* import = module->imports.data[i]; out_u32_at(ctx, offset + IMPORT_NAME_OFFSET, ctx->offset, "FIXUP import name offset"); - out_str(ctx, import->name.start, import->name.length, "import name"); + out_str(ctx, import->func_name.start, import->func_name.length, + "import name"); offset += IMPORT_SIZE; } @@ -962,7 +1204,7 @@ static WasmResult write_command(WasmWriteContext* ctx, WasmCommand* command) { return write_invoke(writer, &command->assert_trap.invoke, WASM_TYPE_VOID); #endif default: - break; + return WASM_OK; } } diff --git a/src/wasm-check.c b/src/wasm-check.c index c3c69876..7f3be956 100644 --- a/src/wasm-check.c +++ b/src/wasm-check.c @@ -28,7 +28,6 @@ STATIC_ASSERT(ARRAY_SIZE(s_type_names) == WASM_TYPE_ALL + 1); typedef struct WasmLabelNode { WasmLabel* label; - int depth; WasmType expected_type; const char* desc; struct WasmLabelNode* next; @@ -38,6 +37,7 @@ typedef struct WasmCheckContext { WasmModule* last_module; WasmLabelNode* top_label; int in_assert_invalid; + int max_depth; } WasmCheckContext; static void print_error(WasmCheckContext* ctx, @@ -72,7 +72,7 @@ static int find_binding_index_by_name(WasmBindingVector* bindings, return -1; } -static int get_index_from_var(WasmBindingVector* bindings, WasmVar* var) { +int wasm_get_index_from_var(WasmBindingVector* bindings, WasmVar* var) { if (var->type == WASM_VAR_TYPE_NAME) return find_binding_index_by_name(bindings, &var->name); return var->index; @@ -105,33 +105,41 @@ int wasm_func_is_exported(WasmModule* module, WasmFunc* func) { } int wasm_get_func_index_by_var(WasmModule* module, WasmVar* var) { - return get_index_from_var(&module->func_bindings, var); + return wasm_get_index_from_var(&module->func_bindings, var); } int wasm_get_func_type_index_by_var(WasmModule* module, WasmVar* var) { - return get_index_from_var(&module->func_type_bindings, var); + return wasm_get_index_from_var(&module->func_type_bindings, var); +} + +int wasm_get_global_index_by_var(WasmModule* module, WasmVar* var) { + return wasm_get_index_from_var(&module->globals.bindings, var); } int wasm_get_import_index_by_var(WasmModule* module, WasmVar* var) { - return get_index_from_var(&module->import_bindings, var); + return wasm_get_index_from_var(&module->import_bindings, var); +} + +int wasm_get_local_index_by_var(WasmFunc* func, WasmVar* var) { + return wasm_get_index_from_var(&func->params_and_locals.bindings, var); } WasmFuncPtr wasm_get_func_by_var(WasmModule* module, WasmVar* var) { - int index = get_index_from_var(&module->func_bindings, var); + int index = wasm_get_index_from_var(&module->func_bindings, var); if (index < 0 || index >= module->funcs.size) return NULL; return module->funcs.data[index]; } WasmFuncTypePtr wasm_get_func_type_by_var(WasmModule* module, WasmVar* var) { - int index = get_index_from_var(&module->func_type_bindings, var); + int index = wasm_get_index_from_var(&module->func_type_bindings, var); if (index < 0 || index >= module->func_types.size) return NULL; return module->func_types.data[index]; } WasmImportPtr wasm_get_import_by_var(WasmModule* module, WasmVar* var) { - int index = get_index_from_var(&module->import_bindings, var); + int index = wasm_get_index_from_var(&module->import_bindings, var); if (index < 0 || index >= module->imports.size) return NULL; return module->imports.data[index]; @@ -162,7 +170,7 @@ static WasmResult check_var(WasmCheckContext* ctx, WasmVar* var, const char* desc, int* out_index) { - int index = get_index_from_var(bindings, var); + int index = wasm_get_index_from_var(bindings, var); if (index >= 0 && index < max_index) { if (out_index) *out_index = index; @@ -328,7 +336,7 @@ static WasmResult check_label_var(WasmCheckContext* ctx, var->name.length, var->name.start); else print_error(ctx, &var->loc, "label variable out of range (max %d)", - top_label ? top_label->depth + 1 : 0); + ctx->max_depth); return WASM_ERROR; } @@ -347,14 +355,15 @@ static WasmResult push_label(WasmCheckContext* ctx, } node->label = label; node->next = ctx->top_label; - node->depth = ctx->top_label ? ctx->top_label->depth + 1 : 0; node->expected_type = expected_type; node->desc = desc; ctx->top_label = node; + ctx->max_depth++; return result; } static void pop_label(WasmCheckContext* ctx) { + ctx->max_depth--; ctx->top_label = ctx->top_label->next; } diff --git a/src/wasm-lexer.c b/src/wasm-lexer.c index 907fe549..cb64c3e6 100644 --- a/src/wasm-lexer.c +++ b/src/wasm-lexer.c @@ -1226,36 +1226,57 @@ typedef struct WasmScannerExtra { #define WASM_SIGN_S WASM_SIGNED #define WASM_SIGN_U WASM_UNSIGNED +/* aliases for non-wrapping/extending loads/stores */ +#define WASM_MEM_OP_TYPE_F32_LOAD32 WASM_MEM_OP_TYPE_F32_LOAD +#define WASM_MEM_OP_TYPE_F32_STORE32 WASM_MEM_OP_TYPE_F32_STORE +#define WASM_MEM_OP_TYPE_F64_LOAD64 WASM_MEM_OP_TYPE_F64_LOAD +#define WASM_MEM_OP_TYPE_F64_STORE64 WASM_MEM_OP_TYPE_F64_STORE +#define WASM_MEM_OP_TYPE_I32_LOAD32 WASM_MEM_OP_TYPE_I32_LOAD +#define WASM_MEM_OP_TYPE_I32_STORE32 WASM_MEM_OP_TYPE_I32_STORE +#define WASM_MEM_OP_TYPE_I64_LOAD64 WASM_MEM_OP_TYPE_I64_LOAD +#define WASM_MEM_OP_TYPE_I64_STORE64 WASM_MEM_OP_TYPE_I64_STORE + #define TEXT \ yylval->text.start = yytext; \ yylval->text.length = yyleng + #define TEXT_AT(offset) \ yylval->text.start = yytext + offset; \ yylval->text.length = yyleng - offset + #define TYPE(type_) yylval->type = WASM_TYPE_##type_ + #define TYPE_STRUCT(struct_, type_) yylval->struct_.type = WASM_TYPE_##type_ -#define MEMOP(type_, name, size_) \ - TYPE_STRUCT(mem, type_); \ - yylval->mem.op_type = WASM_MEM_OP_TYPE_##type_##_##name; \ + +#define MEMOP(type_, name, size_) \ + TYPE_STRUCT(mem, type_); \ + yylval->mem.op_type = WASM_MEM_OP_TYPE_##type_##_##name##size_; \ yylval->mem.size = WASM_MEM_SIZE_##size_ + #define MEMOPSIGN(type_, name, size_, sign_) \ TYPE_STRUCT(mem, type_); \ yylval->mem.op_type = WASM_MEM_OP_TYPE_##type_##_##name##size_##_##sign_; \ yylval->mem.size = WASM_MEM_SIZE_##size_ + #define UNOP(type_, name) TYPE_STRUCT(unary, type_); \ yylval->unary.op_type = WASM_UNARY_OP_TYPE_##type_##_##name + #define BINOP(type_, name) \ TYPE_STRUCT(binary, type_); \ yylval->binary.op_type = WASM_BINARY_OP_TYPE_##type_##_##name + #define CMPOP(type_, name) \ TYPE_STRUCT(compare, type_); \ yylval->compare.op_type = WASM_COMPARE_OP_TYPE_##type_##_##name + #define CONVTYPE(type_, name, type2_) \ TYPE_STRUCT(convert, type_); \ yylval->convert.op_type = WASM_CONVERT_OP_TYPE_##type_##_##name##_##type2_; \ yylval->convert.type2 = WASM_TYPE_##type2_ -#define CASTTYPE(type_, type2_) \ - TYPE_STRUCT(cast, type_); \ + +#define CASTTYPE(type_, type2_) \ + TYPE_STRUCT(cast, type_); \ + yylval->cast.op_type = WASM_CAST_OP_TYPE_##type_##_REINTERPRET_##type2_; \ yylval->cast.type2 = WASM_TYPE_##type2_ #define TOK(name) WASM_TOKEN_TYPE_##name @@ -1263,7 +1284,7 @@ typedef struct WasmScannerExtra { -#line 1267 "src/wasm-lexer.c" +#line 1288 "src/wasm-lexer.c" #define INITIAL 0 #define LINE_COMMENT 1 @@ -1547,10 +1568,10 @@ YY_DECL } { -#line 102 "src/wasm-lexer.l" +#line 123 "src/wasm-lexer.l" -#line 1554 "src/wasm-lexer.c" +#line 1575 "src/wasm-lexer.c" while ( 1 ) /* loops until end-of-file is reached */ { @@ -1621,1141 +1642,1141 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 104 "src/wasm-lexer.l" +#line 125 "src/wasm-lexer.l" { return TOK(LPAR); } YY_BREAK case 2: YY_RULE_SETUP -#line 105 "src/wasm-lexer.l" +#line 126 "src/wasm-lexer.l" { return TOK(RPAR); } YY_BREAK case 3: YY_RULE_SETUP -#line 106 "src/wasm-lexer.l" +#line 127 "src/wasm-lexer.l" { TEXT; return TOK(INT); } YY_BREAK case 4: YY_RULE_SETUP -#line 107 "src/wasm-lexer.l" +#line 128 "src/wasm-lexer.l" { TEXT; return TOK(FLOAT); } YY_BREAK case 5: YY_RULE_SETUP -#line 108 "src/wasm-lexer.l" +#line 129 "src/wasm-lexer.l" { TEXT; return TOK(TEXT); } YY_BREAK case 6: YY_RULE_SETUP -#line 109 "src/wasm-lexer.l" +#line 130 "src/wasm-lexer.l" { BEGIN(BAD_TEXT); } YY_BREAK case 7: YY_RULE_SETUP -#line 110 "src/wasm-lexer.l" +#line 131 "src/wasm-lexer.l" {} YY_BREAK case 8: /* rule 8 can match eol */ YY_RULE_SETUP -#line 111 "src/wasm-lexer.l" +#line 132 "src/wasm-lexer.l" { BEGIN(INITIAL); RESET_COLUMN(yyscanner); yyerror(yylloc, &yyscanner, parser, "newline in string"); } YY_BREAK case YY_STATE_EOF(BAD_TEXT): -#line 115 "src/wasm-lexer.l" +#line 136 "src/wasm-lexer.l" { yyerror(yylloc, &yyscanner, parser, "unexpected EOF"); return TOK(EOF); } YY_BREAK case 9: YY_RULE_SETUP -#line 117 "src/wasm-lexer.l" +#line 138 "src/wasm-lexer.l" { yyerror(yylloc, &yyscanner, parser, "bad escape \"%.*s\"", yyleng, yytext); } YY_BREAK case 10: YY_RULE_SETUP -#line 119 "src/wasm-lexer.l" +#line 140 "src/wasm-lexer.l" { BEGIN(INITIAL); TEXT; return TOK(TEXT); } YY_BREAK case 11: /* rule 11 can match eol */ YY_RULE_SETUP -#line 120 "src/wasm-lexer.l" +#line 141 "src/wasm-lexer.l" { yyerror(yylloc, &yyscanner, parser, "illegal character in string"); } YY_BREAK case 12: YY_RULE_SETUP -#line 122 "src/wasm-lexer.l" +#line 143 "src/wasm-lexer.l" { TYPE(I32); return TOK(VALUE_TYPE); } YY_BREAK case 13: YY_RULE_SETUP -#line 123 "src/wasm-lexer.l" +#line 144 "src/wasm-lexer.l" { TYPE(I64); return TOK(VALUE_TYPE); } YY_BREAK case 14: YY_RULE_SETUP -#line 124 "src/wasm-lexer.l" +#line 145 "src/wasm-lexer.l" { TYPE(F32); return TOK(VALUE_TYPE); } YY_BREAK case 15: YY_RULE_SETUP -#line 125 "src/wasm-lexer.l" +#line 146 "src/wasm-lexer.l" { TYPE(F64); return TOK(VALUE_TYPE); } YY_BREAK case 16: YY_RULE_SETUP -#line 126 "src/wasm-lexer.l" +#line 147 "src/wasm-lexer.l" { return TOK(NOP); } YY_BREAK case 17: YY_RULE_SETUP -#line 127 "src/wasm-lexer.l" +#line 148 "src/wasm-lexer.l" { return TOK(BLOCK); } YY_BREAK case 18: YY_RULE_SETUP -#line 128 "src/wasm-lexer.l" +#line 149 "src/wasm-lexer.l" { return TOK(IF); } YY_BREAK case 19: YY_RULE_SETUP -#line 129 "src/wasm-lexer.l" +#line 150 "src/wasm-lexer.l" { return TOK(IF_ELSE); } YY_BREAK case 20: YY_RULE_SETUP -#line 130 "src/wasm-lexer.l" +#line 151 "src/wasm-lexer.l" { return TOK(LOOP); } YY_BREAK case 21: YY_RULE_SETUP -#line 131 "src/wasm-lexer.l" +#line 152 "src/wasm-lexer.l" { return TOK(LABEL); } YY_BREAK case 22: YY_RULE_SETUP -#line 132 "src/wasm-lexer.l" +#line 153 "src/wasm-lexer.l" { return TOK(BR); } YY_BREAK case 23: YY_RULE_SETUP -#line 133 "src/wasm-lexer.l" +#line 154 "src/wasm-lexer.l" { return TOK(BR_IF); } YY_BREAK case 24: YY_RULE_SETUP -#line 134 "src/wasm-lexer.l" +#line 155 "src/wasm-lexer.l" { return TOK(TABLESWITCH); } YY_BREAK case 25: YY_RULE_SETUP -#line 135 "src/wasm-lexer.l" +#line 156 "src/wasm-lexer.l" { return TOK(CASE); } YY_BREAK case 26: YY_RULE_SETUP -#line 136 "src/wasm-lexer.l" +#line 157 "src/wasm-lexer.l" { return TOK(CALL); } YY_BREAK case 27: YY_RULE_SETUP -#line 137 "src/wasm-lexer.l" +#line 158 "src/wasm-lexer.l" { return TOK(CALL_IMPORT); } YY_BREAK case 28: YY_RULE_SETUP -#line 138 "src/wasm-lexer.l" +#line 159 "src/wasm-lexer.l" { return TOK(CALL_INDIRECT); } YY_BREAK case 29: YY_RULE_SETUP -#line 139 "src/wasm-lexer.l" +#line 160 "src/wasm-lexer.l" { return TOK(RETURN); } YY_BREAK case 30: YY_RULE_SETUP -#line 140 "src/wasm-lexer.l" +#line 161 "src/wasm-lexer.l" { return TOK(GET_LOCAL); } YY_BREAK case 31: YY_RULE_SETUP -#line 141 "src/wasm-lexer.l" +#line 162 "src/wasm-lexer.l" { return TOK(SET_LOCAL); } YY_BREAK case 32: YY_RULE_SETUP -#line 142 "src/wasm-lexer.l" +#line 163 "src/wasm-lexer.l" { MEMOP(I32, LOAD, 32); return TOK(LOAD); } YY_BREAK case 33: YY_RULE_SETUP -#line 143 "src/wasm-lexer.l" +#line 164 "src/wasm-lexer.l" { MEMOP(I64, LOAD, 64); return TOK(LOAD); } YY_BREAK case 34: YY_RULE_SETUP -#line 144 "src/wasm-lexer.l" +#line 165 "src/wasm-lexer.l" { MEMOP(F32, LOAD, 32); return TOK(LOAD); } YY_BREAK case 35: YY_RULE_SETUP -#line 145 "src/wasm-lexer.l" +#line 166 "src/wasm-lexer.l" { MEMOP(F64, LOAD, 64); return TOK(LOAD); } YY_BREAK case 36: YY_RULE_SETUP -#line 146 "src/wasm-lexer.l" +#line 167 "src/wasm-lexer.l" { MEMOP(I32, STORE, 32); return TOK(STORE); } YY_BREAK case 37: YY_RULE_SETUP -#line 147 "src/wasm-lexer.l" +#line 168 "src/wasm-lexer.l" { MEMOP(I64, STORE, 64); return TOK(STORE); } YY_BREAK case 38: YY_RULE_SETUP -#line 148 "src/wasm-lexer.l" +#line 169 "src/wasm-lexer.l" { MEMOP(F32, STORE, 32); return TOK(STORE); } YY_BREAK case 39: YY_RULE_SETUP -#line 149 "src/wasm-lexer.l" +#line 170 "src/wasm-lexer.l" { MEMOP(F64, STORE, 64); return TOK(STORE); } YY_BREAK case 40: YY_RULE_SETUP -#line 150 "src/wasm-lexer.l" +#line 171 "src/wasm-lexer.l" { MEMOPSIGN(I32, LOAD, 8, S); return TOK(LOAD_EXTEND); } YY_BREAK case 41: YY_RULE_SETUP -#line 151 "src/wasm-lexer.l" +#line 172 "src/wasm-lexer.l" { MEMOPSIGN(I64, LOAD, 8, S); return TOK(LOAD_EXTEND); } YY_BREAK case 42: YY_RULE_SETUP -#line 152 "src/wasm-lexer.l" +#line 173 "src/wasm-lexer.l" { MEMOPSIGN(I32, LOAD, 8, U); return TOK(LOAD_EXTEND); } YY_BREAK case 43: YY_RULE_SETUP -#line 153 "src/wasm-lexer.l" +#line 174 "src/wasm-lexer.l" { MEMOPSIGN(I64, LOAD, 8, U); return TOK(LOAD_EXTEND); } YY_BREAK case 44: YY_RULE_SETUP -#line 154 "src/wasm-lexer.l" +#line 175 "src/wasm-lexer.l" { MEMOPSIGN(I32, LOAD, 16, S); return TOK(LOAD_EXTEND); } YY_BREAK case 45: YY_RULE_SETUP -#line 155 "src/wasm-lexer.l" +#line 176 "src/wasm-lexer.l" { MEMOPSIGN(I64, LOAD, 16, S); return TOK(LOAD_EXTEND); } YY_BREAK case 46: YY_RULE_SETUP -#line 156 "src/wasm-lexer.l" +#line 177 "src/wasm-lexer.l" { MEMOPSIGN(I32, LOAD, 16, U); return TOK(LOAD_EXTEND); } YY_BREAK case 47: YY_RULE_SETUP -#line 157 "src/wasm-lexer.l" +#line 178 "src/wasm-lexer.l" { MEMOPSIGN(I64, LOAD, 16, U); return TOK(LOAD_EXTEND); } YY_BREAK case 48: YY_RULE_SETUP -#line 158 "src/wasm-lexer.l" +#line 179 "src/wasm-lexer.l" { MEMOPSIGN(I64, LOAD, 32, S); return TOK(LOAD_EXTEND); } YY_BREAK case 49: YY_RULE_SETUP -#line 159 "src/wasm-lexer.l" +#line 180 "src/wasm-lexer.l" { MEMOPSIGN(I64, LOAD, 32, U); return TOK(LOAD_EXTEND); } YY_BREAK case 50: YY_RULE_SETUP -#line 160 "src/wasm-lexer.l" +#line 181 "src/wasm-lexer.l" { MEMOP(I32, STORE, 8); return TOK(STORE_WRAP); } YY_BREAK case 51: YY_RULE_SETUP -#line 161 "src/wasm-lexer.l" +#line 182 "src/wasm-lexer.l" { MEMOP(I64, STORE, 8); return TOK(STORE_WRAP); } YY_BREAK case 52: YY_RULE_SETUP -#line 162 "src/wasm-lexer.l" +#line 183 "src/wasm-lexer.l" { MEMOP(I32, STORE, 16); return TOK(STORE_WRAP); } YY_BREAK case 53: YY_RULE_SETUP -#line 163 "src/wasm-lexer.l" +#line 184 "src/wasm-lexer.l" { MEMOP(I64, STORE, 16); return TOK(STORE_WRAP); } YY_BREAK case 54: YY_RULE_SETUP -#line 164 "src/wasm-lexer.l" +#line 185 "src/wasm-lexer.l" { MEMOP(I64, STORE, 32); return TOK(STORE_WRAP); } YY_BREAK case 55: YY_RULE_SETUP -#line 165 "src/wasm-lexer.l" +#line 186 "src/wasm-lexer.l" { TEXT_AT(7); return TOK(OFFSET); } YY_BREAK case 56: YY_RULE_SETUP -#line 166 "src/wasm-lexer.l" +#line 187 "src/wasm-lexer.l" { TEXT_AT(6); return TOK(ALIGN); } YY_BREAK case 57: YY_RULE_SETUP -#line 167 "src/wasm-lexer.l" +#line 188 "src/wasm-lexer.l" { TYPE(I32); return TOK(CONST); } YY_BREAK case 58: YY_RULE_SETUP -#line 168 "src/wasm-lexer.l" +#line 189 "src/wasm-lexer.l" { TYPE(I64); return TOK(CONST); } YY_BREAK case 59: YY_RULE_SETUP -#line 169 "src/wasm-lexer.l" +#line 190 "src/wasm-lexer.l" { TYPE(F32); return TOK(CONST); } YY_BREAK case 60: YY_RULE_SETUP -#line 170 "src/wasm-lexer.l" +#line 191 "src/wasm-lexer.l" { TYPE(F64); return TOK(CONST); } YY_BREAK case 61: YY_RULE_SETUP -#line 171 "src/wasm-lexer.l" +#line 192 "src/wasm-lexer.l" { UNOP(I32, NOT); return TOK(UNARY); } YY_BREAK case 62: YY_RULE_SETUP -#line 172 "src/wasm-lexer.l" +#line 193 "src/wasm-lexer.l" { UNOP(I32, CLZ); return TOK(UNARY); } YY_BREAK case 63: YY_RULE_SETUP -#line 173 "src/wasm-lexer.l" +#line 194 "src/wasm-lexer.l" { UNOP(I64, CLZ); return TOK(UNARY); } YY_BREAK case 64: YY_RULE_SETUP -#line 174 "src/wasm-lexer.l" +#line 195 "src/wasm-lexer.l" { UNOP(I32, CTZ); return TOK(UNARY); } YY_BREAK case 65: YY_RULE_SETUP -#line 175 "src/wasm-lexer.l" +#line 196 "src/wasm-lexer.l" { UNOP(I64, CTZ); return TOK(UNARY); } YY_BREAK case 66: YY_RULE_SETUP -#line 176 "src/wasm-lexer.l" +#line 197 "src/wasm-lexer.l" { UNOP(I32, POPCNT); return TOK(UNARY); } YY_BREAK case 67: YY_RULE_SETUP -#line 177 "src/wasm-lexer.l" +#line 198 "src/wasm-lexer.l" { UNOP(I64, POPCNT); return TOK(UNARY); } YY_BREAK case 68: YY_RULE_SETUP -#line 178 "src/wasm-lexer.l" +#line 199 "src/wasm-lexer.l" { UNOP(F32, NEG); return TOK(UNARY); } YY_BREAK case 69: YY_RULE_SETUP -#line 179 "src/wasm-lexer.l" +#line 200 "src/wasm-lexer.l" { UNOP(F64, NEG); return TOK(UNARY); } YY_BREAK case 70: YY_RULE_SETUP -#line 180 "src/wasm-lexer.l" +#line 201 "src/wasm-lexer.l" { UNOP(F32, ABS); return TOK(UNARY); } YY_BREAK case 71: YY_RULE_SETUP -#line 181 "src/wasm-lexer.l" +#line 202 "src/wasm-lexer.l" { UNOP(F64, ABS); return TOK(UNARY); } YY_BREAK case 72: YY_RULE_SETUP -#line 182 "src/wasm-lexer.l" +#line 203 "src/wasm-lexer.l" { UNOP(F32, SQRT); return TOK(UNARY); } YY_BREAK case 73: YY_RULE_SETUP -#line 183 "src/wasm-lexer.l" +#line 204 "src/wasm-lexer.l" { UNOP(F64, SQRT); return TOK(UNARY); } YY_BREAK case 74: YY_RULE_SETUP -#line 184 "src/wasm-lexer.l" +#line 205 "src/wasm-lexer.l" { UNOP(F32, CEIL); return TOK(UNARY); } YY_BREAK case 75: YY_RULE_SETUP -#line 185 "src/wasm-lexer.l" +#line 206 "src/wasm-lexer.l" { UNOP(F64, CEIL); return TOK(UNARY); } YY_BREAK case 76: YY_RULE_SETUP -#line 186 "src/wasm-lexer.l" +#line 207 "src/wasm-lexer.l" { UNOP(F32, FLOOR); return TOK(UNARY); } YY_BREAK case 77: YY_RULE_SETUP -#line 187 "src/wasm-lexer.l" +#line 208 "src/wasm-lexer.l" { UNOP(F64, FLOOR); return TOK(UNARY); } YY_BREAK case 78: YY_RULE_SETUP -#line 188 "src/wasm-lexer.l" +#line 209 "src/wasm-lexer.l" { UNOP(F32, TRUNC); return TOK(UNARY); } YY_BREAK case 79: YY_RULE_SETUP -#line 189 "src/wasm-lexer.l" +#line 210 "src/wasm-lexer.l" { UNOP(F64, TRUNC); return TOK(UNARY); } YY_BREAK case 80: YY_RULE_SETUP -#line 190 "src/wasm-lexer.l" +#line 211 "src/wasm-lexer.l" { UNOP(F32, NEAREST); return TOK(UNARY); } YY_BREAK case 81: YY_RULE_SETUP -#line 191 "src/wasm-lexer.l" +#line 212 "src/wasm-lexer.l" { UNOP(F64, NEAREST); return TOK(UNARY); } YY_BREAK case 82: YY_RULE_SETUP -#line 192 "src/wasm-lexer.l" +#line 213 "src/wasm-lexer.l" { BINOP(I32, ADD); return TOK(BINARY); } YY_BREAK case 83: YY_RULE_SETUP -#line 193 "src/wasm-lexer.l" +#line 214 "src/wasm-lexer.l" { BINOP(I64, ADD); return TOK(BINARY); } YY_BREAK case 84: YY_RULE_SETUP -#line 194 "src/wasm-lexer.l" +#line 215 "src/wasm-lexer.l" { BINOP(I32, SUB); return TOK(BINARY); } YY_BREAK case 85: YY_RULE_SETUP -#line 195 "src/wasm-lexer.l" +#line 216 "src/wasm-lexer.l" { BINOP(I64, SUB); return TOK(BINARY); } YY_BREAK case 86: YY_RULE_SETUP -#line 196 "src/wasm-lexer.l" +#line 217 "src/wasm-lexer.l" { BINOP(I32, MUL); return TOK(BINARY); } YY_BREAK case 87: YY_RULE_SETUP -#line 197 "src/wasm-lexer.l" +#line 218 "src/wasm-lexer.l" { BINOP(I64, MUL); return TOK(BINARY); } YY_BREAK case 88: YY_RULE_SETUP -#line 198 "src/wasm-lexer.l" +#line 219 "src/wasm-lexer.l" { BINOP(I32, DIV_S); return TOK(BINARY); } YY_BREAK case 89: YY_RULE_SETUP -#line 199 "src/wasm-lexer.l" +#line 220 "src/wasm-lexer.l" { BINOP(I64, DIV_S); return TOK(BINARY); } YY_BREAK case 90: YY_RULE_SETUP -#line 200 "src/wasm-lexer.l" +#line 221 "src/wasm-lexer.l" { BINOP(I32, DIV_U); return TOK(BINARY); } YY_BREAK case 91: YY_RULE_SETUP -#line 201 "src/wasm-lexer.l" +#line 222 "src/wasm-lexer.l" { BINOP(I64, DIV_U); return TOK(BINARY); } YY_BREAK case 92: YY_RULE_SETUP -#line 202 "src/wasm-lexer.l" +#line 223 "src/wasm-lexer.l" { BINOP(I32, REM_S); return TOK(BINARY); } YY_BREAK case 93: YY_RULE_SETUP -#line 203 "src/wasm-lexer.l" +#line 224 "src/wasm-lexer.l" { BINOP(I64, REM_S); return TOK(BINARY); } YY_BREAK case 94: YY_RULE_SETUP -#line 204 "src/wasm-lexer.l" +#line 225 "src/wasm-lexer.l" { BINOP(I32, REM_U); return TOK(BINARY); } YY_BREAK case 95: YY_RULE_SETUP -#line 205 "src/wasm-lexer.l" +#line 226 "src/wasm-lexer.l" { BINOP(I64, REM_U); return TOK(BINARY); } YY_BREAK case 96: YY_RULE_SETUP -#line 206 "src/wasm-lexer.l" +#line 227 "src/wasm-lexer.l" { BINOP(I32, AND); return TOK(BINARY); } YY_BREAK case 97: YY_RULE_SETUP -#line 207 "src/wasm-lexer.l" +#line 228 "src/wasm-lexer.l" { BINOP(I64, AND); return TOK(BINARY); } YY_BREAK case 98: YY_RULE_SETUP -#line 208 "src/wasm-lexer.l" +#line 229 "src/wasm-lexer.l" { BINOP(I32, OR); return TOK(BINARY); } YY_BREAK case 99: YY_RULE_SETUP -#line 209 "src/wasm-lexer.l" +#line 230 "src/wasm-lexer.l" { BINOP(I64, OR); return TOK(BINARY); } YY_BREAK case 100: YY_RULE_SETUP -#line 210 "src/wasm-lexer.l" +#line 231 "src/wasm-lexer.l" { BINOP(I32, XOR); return TOK(BINARY); } YY_BREAK case 101: YY_RULE_SETUP -#line 211 "src/wasm-lexer.l" +#line 232 "src/wasm-lexer.l" { BINOP(I64, XOR); return TOK(BINARY); } YY_BREAK case 102: YY_RULE_SETUP -#line 212 "src/wasm-lexer.l" +#line 233 "src/wasm-lexer.l" { BINOP(I32, SHL); return TOK(BINARY); } YY_BREAK case 103: YY_RULE_SETUP -#line 213 "src/wasm-lexer.l" +#line 234 "src/wasm-lexer.l" { BINOP(I64, SHL); return TOK(BINARY); } YY_BREAK case 104: YY_RULE_SETUP -#line 214 "src/wasm-lexer.l" +#line 235 "src/wasm-lexer.l" { BINOP(I32, SHR_S); return TOK(BINARY); } YY_BREAK case 105: YY_RULE_SETUP -#line 215 "src/wasm-lexer.l" +#line 236 "src/wasm-lexer.l" { BINOP(I64, SHR_S); return TOK(BINARY); } YY_BREAK case 106: YY_RULE_SETUP -#line 216 "src/wasm-lexer.l" +#line 237 "src/wasm-lexer.l" { BINOP(I32, SHR_U); return TOK(BINARY); } YY_BREAK case 107: YY_RULE_SETUP -#line 217 "src/wasm-lexer.l" +#line 238 "src/wasm-lexer.l" { BINOP(I64, SHR_U); return TOK(BINARY); } YY_BREAK case 108: YY_RULE_SETUP -#line 218 "src/wasm-lexer.l" +#line 239 "src/wasm-lexer.l" { BINOP(F32, ADD); return TOK(BINARY); } YY_BREAK case 109: YY_RULE_SETUP -#line 219 "src/wasm-lexer.l" +#line 240 "src/wasm-lexer.l" { BINOP(F64, ADD); return TOK(BINARY); } YY_BREAK case 110: YY_RULE_SETUP -#line 220 "src/wasm-lexer.l" +#line 241 "src/wasm-lexer.l" { BINOP(F32, SUB); return TOK(BINARY); } YY_BREAK case 111: YY_RULE_SETUP -#line 221 "src/wasm-lexer.l" +#line 242 "src/wasm-lexer.l" { BINOP(F64, SUB); return TOK(BINARY); } YY_BREAK case 112: YY_RULE_SETUP -#line 222 "src/wasm-lexer.l" +#line 243 "src/wasm-lexer.l" { BINOP(F32, MUL); return TOK(BINARY); } YY_BREAK case 113: YY_RULE_SETUP -#line 223 "src/wasm-lexer.l" +#line 244 "src/wasm-lexer.l" { BINOP(F64, MUL); return TOK(BINARY); } YY_BREAK case 114: YY_RULE_SETUP -#line 224 "src/wasm-lexer.l" +#line 245 "src/wasm-lexer.l" { BINOP(F32, DIV); return TOK(BINARY); } YY_BREAK case 115: YY_RULE_SETUP -#line 225 "src/wasm-lexer.l" +#line 246 "src/wasm-lexer.l" { BINOP(F64, DIV); return TOK(BINARY); } YY_BREAK case 116: YY_RULE_SETUP -#line 226 "src/wasm-lexer.l" +#line 247 "src/wasm-lexer.l" { BINOP(F32, MIN); return TOK(BINARY); } YY_BREAK case 117: YY_RULE_SETUP -#line 227 "src/wasm-lexer.l" +#line 248 "src/wasm-lexer.l" { BINOP(F64, MIN); return TOK(BINARY); } YY_BREAK case 118: YY_RULE_SETUP -#line 228 "src/wasm-lexer.l" +#line 249 "src/wasm-lexer.l" { BINOP(F32, MAX); return TOK(BINARY); } YY_BREAK case 119: YY_RULE_SETUP -#line 229 "src/wasm-lexer.l" +#line 250 "src/wasm-lexer.l" { BINOP(F64, MAX); return TOK(BINARY); } YY_BREAK case 120: YY_RULE_SETUP -#line 230 "src/wasm-lexer.l" +#line 251 "src/wasm-lexer.l" { BINOP(F32, COPYSIGN); return TOK(BINARY); } YY_BREAK case 121: YY_RULE_SETUP -#line 231 "src/wasm-lexer.l" +#line 252 "src/wasm-lexer.l" { BINOP(F64, COPYSIGN); return TOK(BINARY); } YY_BREAK case 122: YY_RULE_SETUP -#line 232 "src/wasm-lexer.l" +#line 253 "src/wasm-lexer.l" { CMPOP(I32, EQ); return TOK(COMPARE); } YY_BREAK case 123: YY_RULE_SETUP -#line 233 "src/wasm-lexer.l" +#line 254 "src/wasm-lexer.l" { CMPOP(I64, EQ); return TOK(COMPARE); } YY_BREAK case 124: YY_RULE_SETUP -#line 234 "src/wasm-lexer.l" +#line 255 "src/wasm-lexer.l" { CMPOP(I32, NE); return TOK(COMPARE); } YY_BREAK case 125: YY_RULE_SETUP -#line 235 "src/wasm-lexer.l" +#line 256 "src/wasm-lexer.l" { CMPOP(I64, NE); return TOK(COMPARE); } YY_BREAK case 126: YY_RULE_SETUP -#line 236 "src/wasm-lexer.l" +#line 257 "src/wasm-lexer.l" { CMPOP(I32, LT_S); return TOK(COMPARE); } YY_BREAK case 127: YY_RULE_SETUP -#line 237 "src/wasm-lexer.l" +#line 258 "src/wasm-lexer.l" { CMPOP(I64, LT_S); return TOK(COMPARE); } YY_BREAK case 128: YY_RULE_SETUP -#line 238 "src/wasm-lexer.l" +#line 259 "src/wasm-lexer.l" { CMPOP(I32, LT_U); return TOK(COMPARE); } YY_BREAK case 129: YY_RULE_SETUP -#line 239 "src/wasm-lexer.l" +#line 260 "src/wasm-lexer.l" { CMPOP(I64, LT_U); return TOK(COMPARE); } YY_BREAK case 130: YY_RULE_SETUP -#line 240 "src/wasm-lexer.l" +#line 261 "src/wasm-lexer.l" { CMPOP(I32, LE_S); return TOK(COMPARE); } YY_BREAK case 131: YY_RULE_SETUP -#line 241 "src/wasm-lexer.l" +#line 262 "src/wasm-lexer.l" { CMPOP(I64, LE_S); return TOK(COMPARE); } YY_BREAK case 132: YY_RULE_SETUP -#line 242 "src/wasm-lexer.l" +#line 263 "src/wasm-lexer.l" { CMPOP(I32, LE_U); return TOK(COMPARE); } YY_BREAK case 133: YY_RULE_SETUP -#line 243 "src/wasm-lexer.l" +#line 264 "src/wasm-lexer.l" { CMPOP(I64, LE_U); return TOK(COMPARE); } YY_BREAK case 134: YY_RULE_SETUP -#line 244 "src/wasm-lexer.l" +#line 265 "src/wasm-lexer.l" { CMPOP(I32, GT_S); return TOK(COMPARE); } YY_BREAK case 135: YY_RULE_SETUP -#line 245 "src/wasm-lexer.l" +#line 266 "src/wasm-lexer.l" { CMPOP(I64, GT_S); return TOK(COMPARE); } YY_BREAK case 136: YY_RULE_SETUP -#line 246 "src/wasm-lexer.l" +#line 267 "src/wasm-lexer.l" { CMPOP(I32, GT_U); return TOK(COMPARE); } YY_BREAK case 137: YY_RULE_SETUP -#line 247 "src/wasm-lexer.l" +#line 268 "src/wasm-lexer.l" { CMPOP(I64, GT_U); return TOK(COMPARE); } YY_BREAK case 138: YY_RULE_SETUP -#line 248 "src/wasm-lexer.l" +#line 269 "src/wasm-lexer.l" { CMPOP(I32, GE_S); return TOK(COMPARE); } YY_BREAK case 139: YY_RULE_SETUP -#line 249 "src/wasm-lexer.l" +#line 270 "src/wasm-lexer.l" { CMPOP(I64, GE_S); return TOK(COMPARE); } YY_BREAK case 140: YY_RULE_SETUP -#line 250 "src/wasm-lexer.l" +#line 271 "src/wasm-lexer.l" { CMPOP(I32, GE_U); return TOK(COMPARE); } YY_BREAK case 141: YY_RULE_SETUP -#line 251 "src/wasm-lexer.l" +#line 272 "src/wasm-lexer.l" { CMPOP(I64, GE_U); return TOK(COMPARE); } YY_BREAK case 142: YY_RULE_SETUP -#line 252 "src/wasm-lexer.l" +#line 273 "src/wasm-lexer.l" { CMPOP(F32, EQ); return TOK(COMPARE); } YY_BREAK case 143: YY_RULE_SETUP -#line 253 "src/wasm-lexer.l" +#line 274 "src/wasm-lexer.l" { CMPOP(F64, EQ); return TOK(COMPARE); } YY_BREAK case 144: YY_RULE_SETUP -#line 254 "src/wasm-lexer.l" +#line 275 "src/wasm-lexer.l" { CMPOP(F32, NE); return TOK(COMPARE); } YY_BREAK case 145: YY_RULE_SETUP -#line 255 "src/wasm-lexer.l" +#line 276 "src/wasm-lexer.l" { CMPOP(F64, NE); return TOK(COMPARE); } YY_BREAK case 146: YY_RULE_SETUP -#line 256 "src/wasm-lexer.l" +#line 277 "src/wasm-lexer.l" { CMPOP(F32, LT); return TOK(COMPARE); } YY_BREAK case 147: YY_RULE_SETUP -#line 257 "src/wasm-lexer.l" +#line 278 "src/wasm-lexer.l" { CMPOP(F64, LT); return TOK(COMPARE); } YY_BREAK case 148: YY_RULE_SETUP -#line 258 "src/wasm-lexer.l" +#line 279 "src/wasm-lexer.l" { CMPOP(F32, LE); return TOK(COMPARE); } YY_BREAK case 149: YY_RULE_SETUP -#line 259 "src/wasm-lexer.l" +#line 280 "src/wasm-lexer.l" { CMPOP(F64, LE); return TOK(COMPARE); } YY_BREAK case 150: YY_RULE_SETUP -#line 260 "src/wasm-lexer.l" +#line 281 "src/wasm-lexer.l" { CMPOP(F32, GT); return TOK(COMPARE); } YY_BREAK case 151: YY_RULE_SETUP -#line 261 "src/wasm-lexer.l" +#line 282 "src/wasm-lexer.l" { CMPOP(F64, GT); return TOK(COMPARE); } YY_BREAK case 152: YY_RULE_SETUP -#line 262 "src/wasm-lexer.l" +#line 283 "src/wasm-lexer.l" { CMPOP(F32, GE); return TOK(COMPARE); } YY_BREAK case 153: YY_RULE_SETUP -#line 263 "src/wasm-lexer.l" +#line 284 "src/wasm-lexer.l" { CMPOP(F64, GE); return TOK(COMPARE); } YY_BREAK case 154: YY_RULE_SETUP -#line 264 "src/wasm-lexer.l" +#line 285 "src/wasm-lexer.l" { CONVTYPE(I64, EXTEND_S, I32); return TOK(CONVERT); } YY_BREAK case 155: YY_RULE_SETUP -#line 265 "src/wasm-lexer.l" +#line 286 "src/wasm-lexer.l" { CONVTYPE(I64, EXTEND_U, I32); return TOK(CONVERT); } YY_BREAK case 156: YY_RULE_SETUP -#line 266 "src/wasm-lexer.l" +#line 287 "src/wasm-lexer.l" { CONVTYPE(I32, WRAP, I64); return TOK(CONVERT); } YY_BREAK case 157: YY_RULE_SETUP -#line 267 "src/wasm-lexer.l" +#line 288 "src/wasm-lexer.l" { CONVTYPE(I32, TRUNC_S, F32); return TOK(CONVERT); } YY_BREAK case 158: YY_RULE_SETUP -#line 268 "src/wasm-lexer.l" +#line 289 "src/wasm-lexer.l" { CONVTYPE(I64, TRUNC_S, F32); return TOK(CONVERT); } YY_BREAK case 159: YY_RULE_SETUP -#line 269 "src/wasm-lexer.l" +#line 290 "src/wasm-lexer.l" { CONVTYPE(I32, TRUNC_S, F64); return TOK(CONVERT); } YY_BREAK case 160: YY_RULE_SETUP -#line 270 "src/wasm-lexer.l" +#line 291 "src/wasm-lexer.l" { CONVTYPE(I64, TRUNC_S, F64); return TOK(CONVERT); } YY_BREAK case 161: YY_RULE_SETUP -#line 271 "src/wasm-lexer.l" +#line 292 "src/wasm-lexer.l" { CONVTYPE(I32, TRUNC_U, F32); return TOK(CONVERT); } YY_BREAK case 162: YY_RULE_SETUP -#line 272 "src/wasm-lexer.l" +#line 293 "src/wasm-lexer.l" { CONVTYPE(I64, TRUNC_U, F32); return TOK(CONVERT); } YY_BREAK case 163: YY_RULE_SETUP -#line 273 "src/wasm-lexer.l" +#line 294 "src/wasm-lexer.l" { CONVTYPE(I32, TRUNC_U, F64); return TOK(CONVERT); } YY_BREAK case 164: YY_RULE_SETUP -#line 274 "src/wasm-lexer.l" +#line 295 "src/wasm-lexer.l" { CONVTYPE(I64, TRUNC_U, F64); return TOK(CONVERT); } YY_BREAK case 165: YY_RULE_SETUP -#line 275 "src/wasm-lexer.l" +#line 296 "src/wasm-lexer.l" { CONVTYPE(F32, CONVERT_S, I32); return TOK(CONVERT); } YY_BREAK case 166: YY_RULE_SETUP -#line 276 "src/wasm-lexer.l" +#line 297 "src/wasm-lexer.l" { CONVTYPE(F64, CONVERT_S, I32); return TOK(CONVERT); } YY_BREAK case 167: YY_RULE_SETUP -#line 277 "src/wasm-lexer.l" +#line 298 "src/wasm-lexer.l" { CONVTYPE(F32, CONVERT_S, I64); return TOK(CONVERT); } YY_BREAK case 168: YY_RULE_SETUP -#line 278 "src/wasm-lexer.l" +#line 299 "src/wasm-lexer.l" { CONVTYPE(F64, CONVERT_S, I64); return TOK(CONVERT); } YY_BREAK case 169: YY_RULE_SETUP -#line 279 "src/wasm-lexer.l" +#line 300 "src/wasm-lexer.l" { CONVTYPE(F32, CONVERT_U, I32); return TOK(CONVERT); } YY_BREAK case 170: YY_RULE_SETUP -#line 280 "src/wasm-lexer.l" +#line 301 "src/wasm-lexer.l" { CONVTYPE(F64, CONVERT_U, I32); return TOK(CONVERT); } YY_BREAK case 171: YY_RULE_SETUP -#line 281 "src/wasm-lexer.l" +#line 302 "src/wasm-lexer.l" { CONVTYPE(F32, CONVERT_U, I64); return TOK(CONVERT); } YY_BREAK case 172: YY_RULE_SETUP -#line 282 "src/wasm-lexer.l" +#line 303 "src/wasm-lexer.l" { CONVTYPE(F64, CONVERT_U, I64); return TOK(CONVERT); } YY_BREAK case 173: YY_RULE_SETUP -#line 283 "src/wasm-lexer.l" +#line 304 "src/wasm-lexer.l" { CONVTYPE(F64, PROMOTE, F32); return TOK(CONVERT); } YY_BREAK case 174: YY_RULE_SETUP -#line 284 "src/wasm-lexer.l" +#line 305 "src/wasm-lexer.l" { CONVTYPE(F32, DEMOTE, F64); return TOK(CONVERT); } YY_BREAK case 175: YY_RULE_SETUP -#line 285 "src/wasm-lexer.l" +#line 306 "src/wasm-lexer.l" { CASTTYPE(F32, I32); return TOK(CAST); } YY_BREAK case 176: YY_RULE_SETUP -#line 286 "src/wasm-lexer.l" +#line 307 "src/wasm-lexer.l" { CASTTYPE(I32, F32); return TOK(CAST); } YY_BREAK case 177: YY_RULE_SETUP -#line 287 "src/wasm-lexer.l" +#line 308 "src/wasm-lexer.l" { CASTTYPE(F64, I64); return TOK(CAST); } YY_BREAK case 178: YY_RULE_SETUP -#line 288 "src/wasm-lexer.l" +#line 309 "src/wasm-lexer.l" { CASTTYPE(I64, F64); return TOK(CAST); } YY_BREAK case 179: YY_RULE_SETUP -#line 289 "src/wasm-lexer.l" +#line 310 "src/wasm-lexer.l" { TYPE(I32); return TOK(SELECT); } YY_BREAK case 180: YY_RULE_SETUP -#line 290 "src/wasm-lexer.l" +#line 311 "src/wasm-lexer.l" { TYPE(I64); return TOK(SELECT); } YY_BREAK case 181: YY_RULE_SETUP -#line 291 "src/wasm-lexer.l" +#line 312 "src/wasm-lexer.l" { TYPE(F32); return TOK(SELECT); } YY_BREAK case 182: YY_RULE_SETUP -#line 292 "src/wasm-lexer.l" +#line 313 "src/wasm-lexer.l" { TYPE(F64); return TOK(SELECT); } YY_BREAK case 183: YY_RULE_SETUP -#line 293 "src/wasm-lexer.l" +#line 314 "src/wasm-lexer.l" { return TOK(UNREACHABLE); } YY_BREAK case 184: YY_RULE_SETUP -#line 294 "src/wasm-lexer.l" +#line 315 "src/wasm-lexer.l" { return TOK(MEMORY_SIZE); } YY_BREAK case 185: YY_RULE_SETUP -#line 295 "src/wasm-lexer.l" +#line 316 "src/wasm-lexer.l" { return TOK(GROW_MEMORY); } YY_BREAK case 186: YY_RULE_SETUP -#line 296 "src/wasm-lexer.l" +#line 317 "src/wasm-lexer.l" { return TOK(HAS_FEATURE); } YY_BREAK case 187: YY_RULE_SETUP -#line 297 "src/wasm-lexer.l" +#line 318 "src/wasm-lexer.l" { return TOK(TYPE); } YY_BREAK case 188: YY_RULE_SETUP -#line 298 "src/wasm-lexer.l" +#line 319 "src/wasm-lexer.l" { return TOK(FUNC); } YY_BREAK case 189: YY_RULE_SETUP -#line 299 "src/wasm-lexer.l" +#line 320 "src/wasm-lexer.l" { return TOK(PARAM); } YY_BREAK case 190: YY_RULE_SETUP -#line 300 "src/wasm-lexer.l" +#line 321 "src/wasm-lexer.l" { return TOK(RESULT); } YY_BREAK case 191: YY_RULE_SETUP -#line 301 "src/wasm-lexer.l" +#line 322 "src/wasm-lexer.l" { return TOK(LOCAL); } YY_BREAK case 192: YY_RULE_SETUP -#line 302 "src/wasm-lexer.l" +#line 323 "src/wasm-lexer.l" { return TOK(MODULE); } YY_BREAK case 193: YY_RULE_SETUP -#line 303 "src/wasm-lexer.l" +#line 324 "src/wasm-lexer.l" { return TOK(MEMORY); } YY_BREAK case 194: YY_RULE_SETUP -#line 304 "src/wasm-lexer.l" +#line 325 "src/wasm-lexer.l" { return TOK(SEGMENT); } YY_BREAK case 195: YY_RULE_SETUP -#line 305 "src/wasm-lexer.l" +#line 326 "src/wasm-lexer.l" { return TOK(IMPORT); } YY_BREAK case 196: YY_RULE_SETUP -#line 306 "src/wasm-lexer.l" +#line 327 "src/wasm-lexer.l" { return TOK(EXPORT); } YY_BREAK case 197: YY_RULE_SETUP -#line 307 "src/wasm-lexer.l" +#line 328 "src/wasm-lexer.l" { return TOK(TABLE); } YY_BREAK case 198: YY_RULE_SETUP -#line 308 "src/wasm-lexer.l" +#line 329 "src/wasm-lexer.l" { return TOK(ASSERT_INVALID); } YY_BREAK case 199: YY_RULE_SETUP -#line 309 "src/wasm-lexer.l" +#line 330 "src/wasm-lexer.l" { return TOK(ASSERT_RETURN); } YY_BREAK case 200: YY_RULE_SETUP -#line 310 "src/wasm-lexer.l" +#line 331 "src/wasm-lexer.l" { return TOK(ASSERT_RETURN_NAN); } YY_BREAK case 201: YY_RULE_SETUP -#line 311 "src/wasm-lexer.l" +#line 332 "src/wasm-lexer.l" { return TOK(ASSERT_TRAP); } YY_BREAK case 202: YY_RULE_SETUP -#line 312 "src/wasm-lexer.l" +#line 333 "src/wasm-lexer.l" { return TOK(INVOKE); } YY_BREAK case 203: YY_RULE_SETUP -#line 313 "src/wasm-lexer.l" +#line 334 "src/wasm-lexer.l" { TEXT; return TOK(VAR); } YY_BREAK case 204: YY_RULE_SETUP -#line 315 "src/wasm-lexer.l" +#line 336 "src/wasm-lexer.l" { return TOK(BR); } YY_BREAK case 205: YY_RULE_SETUP -#line 316 "src/wasm-lexer.l" +#line 337 "src/wasm-lexer.l" { return TOK(GLOBAL); } YY_BREAK case 206: YY_RULE_SETUP -#line 317 "src/wasm-lexer.l" +#line 338 "src/wasm-lexer.l" { return TOK(LOAD_GLOBAL); } YY_BREAK case 207: YY_RULE_SETUP -#line 318 "src/wasm-lexer.l" +#line 339 "src/wasm-lexer.l" { return TOK(STORE_GLOBAL); } YY_BREAK case 208: YY_RULE_SETUP -#line 319 "src/wasm-lexer.l" +#line 340 "src/wasm-lexer.l" { return TOK(PAGE_SIZE); } YY_BREAK case 209: YY_RULE_SETUP -#line 321 "src/wasm-lexer.l" +#line 342 "src/wasm-lexer.l" { BEGIN(LINE_COMMENT); } YY_BREAK case 210: /* rule 210 can match eol */ YY_RULE_SETUP -#line 322 "src/wasm-lexer.l" +#line 343 "src/wasm-lexer.l" { RESET_COLUMN(yyscanner); BEGIN(INITIAL); } YY_BREAK case YY_STATE_EOF(LINE_COMMENT): -#line 323 "src/wasm-lexer.l" +#line 344 "src/wasm-lexer.l" { return TOK(EOF); } YY_BREAK case 211: YY_RULE_SETUP -#line 324 "src/wasm-lexer.l" +#line 345 "src/wasm-lexer.l" YY_BREAK case 212: YY_RULE_SETUP -#line 325 "src/wasm-lexer.l" +#line 346 "src/wasm-lexer.l" { BEGIN(BLOCK_COMMENT); COMMENT_NESTING(yyscanner) = 1; } YY_BREAK case 213: YY_RULE_SETUP -#line 326 "src/wasm-lexer.l" +#line 347 "src/wasm-lexer.l" { COMMENT_NESTING(yyscanner)++; } YY_BREAK case 214: YY_RULE_SETUP -#line 327 "src/wasm-lexer.l" +#line 348 "src/wasm-lexer.l" { if (--COMMENT_NESTING(yyscanner) == 0) BEGIN(INITIAL); } YY_BREAK case 215: /* rule 215 can match eol */ YY_RULE_SETUP -#line 328 "src/wasm-lexer.l" +#line 349 "src/wasm-lexer.l" { RESET_COLUMN(yyscanner); } YY_BREAK case YY_STATE_EOF(BLOCK_COMMENT): -#line 329 "src/wasm-lexer.l" +#line 350 "src/wasm-lexer.l" { yyerror(yylloc, &yyscanner, parser, "unexpected EOF"); return TOK(EOF); } YY_BREAK case 216: YY_RULE_SETUP -#line 332 "src/wasm-lexer.l" +#line 353 "src/wasm-lexer.l" YY_BREAK case 217: /* rule 217 can match eol */ YY_RULE_SETUP -#line 333 "src/wasm-lexer.l" +#line 354 "src/wasm-lexer.l" { RESET_COLUMN(yyscanner); } YY_BREAK case 218: YY_RULE_SETUP -#line 334 "src/wasm-lexer.l" +#line 355 "src/wasm-lexer.l" YY_BREAK case YY_STATE_EOF(INITIAL): -#line 335 "src/wasm-lexer.l" +#line 356 "src/wasm-lexer.l" { return TOK(EOF); } YY_BREAK case 219: YY_RULE_SETUP -#line 336 "src/wasm-lexer.l" +#line 357 "src/wasm-lexer.l" { yyerror(yylloc, &yyscanner, parser, "unexpected token \"%.*s\"", yyleng, yytext); } YY_BREAK case 220: YY_RULE_SETUP -#line 338 "src/wasm-lexer.l" +#line 359 "src/wasm-lexer.l" { yyerror(yylloc, &yyscanner, parser, "unexpected char"); } YY_BREAK case 221: YY_RULE_SETUP -#line 341 "src/wasm-lexer.l" +#line 362 "src/wasm-lexer.l" ECHO; YY_BREAK -#line 2759 "src/wasm-lexer.c" +#line 2780 "src/wasm-lexer.c" case YY_END_OF_BUFFER: { @@ -3941,7 +3962,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 340 "src/wasm-lexer.l" +#line 361 "src/wasm-lexer.l" diff --git a/src/wasm-lexer.l b/src/wasm-lexer.l index f57c9c19..d7dc9386 100644 --- a/src/wasm-lexer.l +++ b/src/wasm-lexer.l @@ -31,36 +31,57 @@ typedef struct WasmScannerExtra { #define WASM_SIGN_S WASM_SIGNED #define WASM_SIGN_U WASM_UNSIGNED +/* aliases for non-wrapping/extending loads/stores */ +#define WASM_MEM_OP_TYPE_F32_LOAD32 WASM_MEM_OP_TYPE_F32_LOAD +#define WASM_MEM_OP_TYPE_F32_STORE32 WASM_MEM_OP_TYPE_F32_STORE +#define WASM_MEM_OP_TYPE_F64_LOAD64 WASM_MEM_OP_TYPE_F64_LOAD +#define WASM_MEM_OP_TYPE_F64_STORE64 WASM_MEM_OP_TYPE_F64_STORE +#define WASM_MEM_OP_TYPE_I32_LOAD32 WASM_MEM_OP_TYPE_I32_LOAD +#define WASM_MEM_OP_TYPE_I32_STORE32 WASM_MEM_OP_TYPE_I32_STORE +#define WASM_MEM_OP_TYPE_I64_LOAD64 WASM_MEM_OP_TYPE_I64_LOAD +#define WASM_MEM_OP_TYPE_I64_STORE64 WASM_MEM_OP_TYPE_I64_STORE + #define TEXT \ yylval->text.start = yytext; \ yylval->text.length = yyleng + #define TEXT_AT(offset) \ yylval->text.start = yytext + offset; \ yylval->text.length = yyleng - offset + #define TYPE(type_) yylval->type = WASM_TYPE_##type_ + #define TYPE_STRUCT(struct_, type_) yylval->struct_.type = WASM_TYPE_##type_ -#define MEMOP(type_, name, size_) \ - TYPE_STRUCT(mem, type_); \ - yylval->mem.op_type = WASM_MEM_OP_TYPE_##type_##_##name; \ + +#define MEMOP(type_, name, size_) \ + TYPE_STRUCT(mem, type_); \ + yylval->mem.op_type = WASM_MEM_OP_TYPE_##type_##_##name##size_; \ yylval->mem.size = WASM_MEM_SIZE_##size_ + #define MEMOPSIGN(type_, name, size_, sign_) \ TYPE_STRUCT(mem, type_); \ yylval->mem.op_type = WASM_MEM_OP_TYPE_##type_##_##name##size_##_##sign_; \ yylval->mem.size = WASM_MEM_SIZE_##size_ + #define UNOP(type_, name) TYPE_STRUCT(unary, type_); \ yylval->unary.op_type = WASM_UNARY_OP_TYPE_##type_##_##name + #define BINOP(type_, name) \ TYPE_STRUCT(binary, type_); \ yylval->binary.op_type = WASM_BINARY_OP_TYPE_##type_##_##name + #define CMPOP(type_, name) \ TYPE_STRUCT(compare, type_); \ yylval->compare.op_type = WASM_COMPARE_OP_TYPE_##type_##_##name + #define CONVTYPE(type_, name, type2_) \ TYPE_STRUCT(convert, type_); \ yylval->convert.op_type = WASM_CONVERT_OP_TYPE_##type_##_##name##_##type2_; \ yylval->convert.type2 = WASM_TYPE_##type2_ -#define CASTTYPE(type_, type2_) \ - TYPE_STRUCT(cast, type_); \ + +#define CASTTYPE(type_, type2_) \ + TYPE_STRUCT(cast, type_); \ + yylval->cast.op_type = WASM_CAST_OP_TYPE_##type_##_REINTERPRET_##type2_; \ yylval->cast.type2 = WASM_TYPE_##type2_ #define TOK(name) WASM_TOKEN_TYPE_##name diff --git a/src/wasm-parser.c b/src/wasm-parser.c index 6d1d4688..9e26723e 100644 --- a/src/wasm-parser.c +++ b/src/wasm-parser.c @@ -495,16 +495,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 6 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 737 +#define YYLAST 741 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 64 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 42 /* YYNRULES -- Number of rules. */ -#define YYNRULES 184 +#define YYNRULES 185 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 354 +#define YYNSTATES 356 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ @@ -559,22 +559,22 @@ static const yytype_uint16 yyrline[] = 0, 136, 136, 137, 140, 141, 145, 149, 156, 157, 161, 169, 176, 177, 180, 184, 185, 189, 190, 197, 198, 209, 212, 213, 217, 222, 228, 233, 238, 244, - 249, 256, 261, 265, 285, 290, 295, 301, 305, 310, - 317, 325, 332, 340, 348, 353, 359, 366, 372, 377, - 382, 383, 384, 388, 392, 396, 401, 404, 405, 408, - 409, 412, 413, 417, 421, 427, 428, 431, 432, 435, - 436, 443, 448, 456, 461, 471, 474, 479, 487, 492, - 502, 505, 506, 510, 515, 521, 528, 536, 545, 553, - 560, 567, 574, 580, 587, 595, 602, 608, 615, 621, - 626, 632, 637, 643, 650, 658, 665, 671, 678, 684, - 689, 695, 702, 708, 713, 717, 722, 728, 735, 743, - 750, 756, 763, 769, 774, 780, 787, 793, 798, 804, - 809, 813, 818, 824, 831, 837, 842, 848, 853, 857, - 862, 868, 873, 877, 882, 888, 888, 899, 908, 909, - 913, 923, 934, 938, 945, 949, 956, 964, 971, 982, - 989, 993, 1004, 1005, 1012, 1019, 1026, 1033, 1040, 1047, - 1056, 1120, 1121, 1127, 1132, 1139, 1145, 1154, 1155, 1159, - 1168, 1169, 1172, 1173, 1177 + 250, 255, 262, 267, 271, 291, 296, 301, 307, 311, + 316, 323, 331, 338, 346, 354, 359, 365, 372, 378, + 383, 388, 389, 390, 394, 398, 402, 407, 410, 411, + 414, 415, 418, 419, 423, 427, 433, 434, 437, 438, + 441, 442, 449, 454, 462, 467, 477, 480, 485, 493, + 498, 508, 511, 514, 518, 523, 529, 536, 544, 553, + 561, 568, 575, 582, 588, 595, 603, 610, 616, 623, + 629, 634, 640, 645, 651, 658, 666, 673, 679, 686, + 692, 697, 703, 710, 716, 721, 725, 730, 736, 743, + 751, 758, 764, 771, 777, 782, 788, 795, 801, 806, + 812, 817, 821, 826, 832, 839, 845, 850, 856, 861, + 865, 870, 876, 881, 885, 890, 896, 896, 907, 916, + 917, 921, 931, 942, 946, 953, 957, 964, 972, 979, + 990, 997, 1001, 1012, 1013, 1020, 1027, 1034, 1041, 1048, + 1055, 1064, 1128, 1129, 1135, 1140, 1147, 1153, 1162, 1163, + 1167, 1176, 1177, 1180, 1181, 1185 }; #endif @@ -619,10 +619,10 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -154 +#define YYPACT_NINF -155 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-154))) + (!!((Yystate) == (-155))) #define YYTABLE_NINF -1 @@ -633,42 +633,42 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - -154, 3, 16, -16, -154, -154, -154, -154, 15, 42, - 51, 61, 59, 111, 37, 63, 64, 91, 96, -154, - 20, -154, -154, -154, -154, -154, -154, -154, -154, 107, - 151, 153, 165, 121, -154, 27, 164, 124, 169, -154, - 171, -154, -154, -154, -154, 148, -154, -154, 50, 138, - -154, 178, 177, 182, 185, 29, 69, 52, 184, 140, - 142, 144, 145, 410, 191, -154, 195, 196, 197, 198, - 200, 207, 201, 173, -154, 149, 210, 208, -154, -154, - 212, -154, -154, -154, -154, 214, 211, 215, 213, -154, - -154, 218, -154, 171, 195, 195, 171, 171, 14, 29, - 171, 29, 29, 29, 195, 29, 29, 194, 194, 194, - 194, 145, 195, 195, 195, 195, 195, 195, 29, 171, - 216, 171, -154, -154, 195, 219, 29, 29, -154, 223, - 195, 196, 197, 198, 200, 675, -154, 463, 195, 197, - 198, 569, 195, 198, 622, 195, 516, 195, 196, 197, - 198, -154, 115, 224, 201, 160, 186, -154, -154, 88, - 226, 233, 210, -154, -154, -154, 235, -154, 237, -154, - -154, 195, 195, 195, 171, 195, 195, -154, -154, 195, - 195, 195, 195, 195, -154, -154, 195, -154, 217, 217, - 217, 217, -154, -154, 195, 195, -154, -154, 195, 238, - 53, 234, 241, 76, 240, -154, -154, -154, 195, -154, - 195, 197, 198, 195, 198, 195, 195, 196, 197, 198, - 171, 195, 198, 195, 195, 171, 195, 197, 198, 195, - 198, 195, -154, 242, 243, 246, -154, 247, -154, -154, - 249, 250, -154, -154, 195, -154, 195, 195, -154, -154, - -154, 252, 195, -154, -154, 195, -154, -154, 195, 195, - 195, 195, -154, -154, 195, -154, -154, 253, -154, -154, - 254, -154, 195, 198, 195, 195, 195, 197, 198, 195, - 198, 195, 94, 251, 195, 103, 255, 195, 198, 195, - 195, 114, 257, -154, 258, 239, -154, -154, -154, -154, - 221, -154, -154, 195, -154, 195, -154, -154, -154, 195, - 195, 198, 195, 195, -154, 259, -154, 267, 195, 256, - -154, -154, 270, -154, -154, -154, 195, -154, -154, 236, - -154, 162, 266, 81, 274, -154, 276, 29, 29, -154, - -154, 277, 280, 282, -154, -154, 271, -154, 118, 195, - 285, 288, -154, -154 + -155, 7, 41, 10, -155, -155, -155, -155, 57, 67, + 70, 82, 100, 14, 58, 103, 55, 62, 66, -155, + 83, -155, -155, -155, -155, -155, -155, -155, -155, 162, + 160, 163, 166, 77, -155, 28, 172, 90, 171, -155, + 173, -155, -155, -155, -155, 148, -155, -155, 30, 143, + -155, 180, 183, 185, 187, 11, 107, 33, 186, 114, + 134, 137, 141, 414, 195, -155, 197, 198, 199, 201, + 202, 209, 203, 175, -155, 151, 212, 210, -155, -155, + 214, -155, -155, -155, -155, 216, 213, 217, 215, -155, + -155, 220, -155, 173, 197, 197, 173, 173, 27, 11, + 173, 11, 11, 11, 197, 11, 11, 196, 196, 196, + 196, 141, 197, 197, 197, 197, 197, 197, 11, 173, + 218, 173, -155, -155, 197, 221, 11, 11, -155, 225, + 197, 198, 199, 201, 202, 679, -155, 467, 197, 199, + 201, 573, 197, 201, 626, 197, 520, 197, 198, 199, + 201, -155, 116, 226, 203, 156, 188, -155, -155, 94, + 228, 235, 212, -155, -155, -155, 237, -155, 239, -155, + -155, 197, 197, 197, 173, 197, 197, 197, -155, -155, + 197, 197, 197, 197, 197, -155, -155, 197, -155, 219, + 219, 219, 219, -155, -155, 197, 197, -155, -155, 197, + 240, 36, 236, 243, 49, 242, -155, -155, -155, 197, + -155, 197, 199, 201, 197, 201, 197, 197, 198, 199, + 201, 173, 197, 201, 197, 197, 173, 197, 199, 201, + 197, 201, 197, -155, 244, 245, 248, -155, 249, -155, + -155, 251, 252, -155, -155, 197, -155, 197, 197, 197, + -155, -155, -155, -155, 254, -155, -155, 197, -155, -155, + 197, 197, 197, 197, -155, -155, 197, -155, -155, 255, + -155, -155, 256, -155, 197, 201, 197, 197, 197, 199, + 201, 197, 201, 197, 53, 253, 197, 65, 257, 197, + 201, 197, 197, 73, 259, -155, 260, 241, -155, -155, + -155, -155, 224, -155, -155, 197, -155, 197, -155, -155, + -155, 197, 197, 201, 197, 197, -155, 261, -155, 266, + 197, 258, -155, -155, 270, -155, -155, -155, 197, -155, + -155, 238, -155, 161, 268, 40, 275, -155, 277, 11, + 11, -155, -155, 279, 282, 284, -155, -155, 269, -155, + 31, 197, 285, 288, -155, -155 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -676,59 +676,59 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 177, 184, 0, 0, 171, 178, 1, 162, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, - 0, 170, 163, 168, 167, 166, 164, 165, 169, 0, - 0, 0, 0, 0, 145, 0, 0, 0, 0, 12, - 2, 173, 182, 182, 182, 0, 172, 183, 81, 0, - 14, 0, 148, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82, 59, 144, 130, 138, 142, - 114, 0, 4, 0, 148, 0, 4, 0, 10, 11, - 0, 154, 13, 160, 3, 0, 180, 0, 0, 8, - 9, 0, 22, 15, 0, 0, 15, 15, 57, 0, - 15, 0, 0, 0, 57, 0, 0, 17, 17, 17, + 178, 185, 0, 0, 172, 179, 1, 163, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, + 0, 171, 164, 169, 168, 167, 165, 166, 170, 0, + 0, 0, 0, 0, 146, 0, 0, 0, 0, 12, + 2, 174, 183, 183, 183, 0, 173, 184, 82, 0, + 14, 0, 149, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 83, 60, 145, 131, 139, 143, + 115, 0, 4, 0, 149, 0, 4, 0, 10, 11, + 0, 155, 13, 161, 3, 0, 181, 0, 0, 8, + 9, 0, 22, 15, 0, 0, 15, 15, 58, 0, + 15, 0, 0, 0, 58, 0, 0, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 2, - 0, 2, 50, 51, 0, 0, 0, 0, 56, 0, - 113, 101, 109, 99, 83, 0, 60, 0, 137, 131, - 135, 0, 141, 139, 0, 143, 0, 129, 115, 123, - 127, 146, 0, 0, 4, 0, 0, 151, 149, 0, - 0, 0, 4, 159, 161, 181, 0, 175, 0, 179, - 16, 23, 0, 0, 15, 0, 57, 58, 30, 0, - 0, 61, 61, 0, 32, 37, 0, 18, 19, 19, - 19, 19, 43, 44, 0, 0, 48, 49, 0, 0, - 0, 0, 0, 0, 0, 52, 53, 54, 0, 21, - 108, 102, 106, 112, 110, 100, 98, 84, 92, 96, - 2, 134, 132, 136, 140, 2, 122, 116, 120, 126, - 124, 128, 2, 0, 0, 0, 150, 0, 157, 155, - 0, 0, 174, 176, 24, 26, 0, 61, 29, 31, - 27, 0, 62, 34, 35, 61, 38, 20, 0, 0, - 0, 0, 45, 47, 0, 80, 71, 0, 75, 76, - 0, 55, 105, 103, 107, 111, 91, 85, 89, 95, - 93, 97, 0, 0, 133, 0, 0, 119, 117, 121, - 125, 0, 0, 152, 0, 0, 158, 156, 25, 28, - 0, 36, 39, 0, 41, 0, 46, 72, 77, 104, - 88, 86, 90, 94, 73, 0, 78, 0, 118, 5, - 7, 153, 0, 65, 40, 42, 87, 74, 79, 0, - 147, 0, 0, 0, 0, 66, 0, 0, 0, 69, - 6, 0, 0, 33, 64, 63, 0, 70, 61, 61, - 0, 0, 67, 68 + 0, 2, 51, 52, 0, 0, 0, 0, 57, 0, + 114, 102, 110, 100, 84, 0, 61, 0, 138, 132, + 136, 0, 142, 140, 0, 144, 0, 130, 116, 124, + 128, 147, 0, 0, 4, 0, 0, 152, 150, 0, + 0, 0, 4, 160, 162, 182, 0, 176, 0, 180, + 16, 23, 0, 0, 16, 62, 0, 58, 59, 31, + 0, 0, 62, 62, 0, 33, 38, 0, 18, 19, + 19, 19, 19, 44, 45, 0, 0, 49, 50, 0, + 0, 0, 0, 0, 0, 0, 53, 54, 55, 0, + 21, 109, 103, 107, 113, 111, 101, 99, 85, 93, + 97, 2, 135, 133, 137, 141, 2, 123, 117, 121, + 127, 125, 129, 2, 0, 0, 0, 151, 0, 158, + 156, 0, 0, 175, 177, 24, 26, 0, 62, 63, + 28, 30, 32, 27, 0, 35, 36, 62, 39, 20, + 0, 0, 0, 0, 46, 48, 0, 81, 72, 0, + 76, 77, 0, 56, 106, 104, 108, 112, 92, 86, + 90, 96, 94, 98, 0, 0, 134, 0, 0, 120, + 118, 122, 126, 0, 0, 153, 0, 0, 159, 157, + 25, 29, 0, 37, 40, 0, 42, 0, 47, 73, + 78, 105, 89, 87, 91, 95, 74, 0, 79, 0, + 119, 5, 7, 154, 0, 66, 41, 43, 88, 75, + 80, 0, 148, 0, 0, 0, 0, 67, 0, 0, + 0, 70, 6, 0, 0, 34, 65, 64, 0, 71, + 62, 62, 0, 0, 68, 69 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -154, -112, -45, 175, -55, -154, -35, -64, 26, -52, - 93, -154, -94, -44, -153, -78, -154, -154, -154, -43, - -15, -56, -61, -154, -154, -154, -154, 220, -154, -154, - -154, -154, -154, -154, -154, 287, -154, -154, 225, -154, - 98, -154 + -155, -112, -54, 147, -55, -155, -35, 29, 35, -42, + 95, -155, -98, -44, -154, -41, -155, -155, -155, -43, + -15, -56, -61, -155, -155, -155, -155, 222, -155, -155, + -155, -155, -155, -155, -155, 289, -155, -155, 207, -155, + 109, -155 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 57, 153, 91, 80, 56, 170, 171, 188, 258, - 65, 129, 178, 252, 253, 335, 331, 347, 343, 67, + -1, 57, 153, 91, 80, 56, 170, 171, 189, 260, + 65, 129, 179, 249, 250, 337, 333, 349, 345, 67, 68, 69, 70, 71, 22, 48, 158, 75, 23, 24, 25, 26, 27, 28, 13, 4, 5, 1, 47, 166, 33, 2 @@ -739,158 +739,160 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint16 yytable[] = { - 51, 82, 54, 134, 66, 58, 3, 200, 133, 203, - 184, 140, 143, 64, 150, 161, 6, 135, 14, 78, - 130, 131, 79, 138, 142, 145, 147, 148, 7, 254, - 49, 160, 174, 175, 78, 50, 180, 79, 8, 9, - 10, 11, 12, 176, 179, 16, 181, 182, 183, 132, - 185, 186, 139, 63, 17, 149, 83, 266, 50, 34, - 35, 84, 84, 199, 18, 36, 19, 37, 38, 39, - 29, 207, 208, 81, 78, 212, 214, 79, 219, 40, - 269, 7, 249, 222, 201, 84, 204, 210, 213, 215, - 216, 217, 228, 230, 299, 221, 223, 337, 314, 224, - 338, 241, 301, 84, 226, 229, 231, 316, 282, 235, - 247, 41, 84, 285, 20, 21, 211, 240, 319, 218, - 291, 135, 30, 84, 45, 46, 50, 244, 118, 232, - 233, 53, 50, 227, 189, 190, 191, 259, 260, 261, - 59, 60, 61, 45, 86, 45, 87, 45, 88, 31, - 89, 90, 156, 157, 32, 273, 232, 233, 42, 136, - 43, 278, 280, 156, 236, 333, 334, 272, 274, 52, - 275, 288, 44, 276, 279, 281, 55, 72, 284, 50, - 62, 73, 74, 287, 289, 283, 290, 172, 173, 76, - 286, 177, 77, 85, 63, 350, 351, 177, 135, 137, - 141, 144, 277, 146, 152, 193, 194, 195, 196, 197, - 198, 151, 154, 159, 45, 162, 163, 205, 164, 167, - 168, 311, 169, 136, 187, 202, 206, 209, 234, 309, - 238, 136, 237, 310, 312, 136, 313, 239, 136, 242, - 136, 243, 265, 267, 318, 268, 322, 293, 257, 270, - 294, 292, 295, 296, 297, 300, 339, 307, 308, 329, - 315, 320, 321, 327, 317, 245, 246, 326, 248, 177, - 323, 328, 250, 251, 330, 336, 255, 333, 332, 256, - 340, 344, 341, 342, 345, 346, 192, 262, 263, 352, - 348, 264, 353, 0, 155, 15, 0, 0, 0, 0, - 0, 271, 0, 136, 0, 0, 136, 0, 136, 136, - 0, 165, 0, 349, 136, 0, 136, 136, 0, 136, - 0, 0, 136, 0, 136, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 136, 0, 298, - 0, 0, 0, 0, 0, 136, 0, 0, 0, 0, - 0, 302, 303, 304, 305, 0, 0, 306, 0, 0, - 0, 0, 0, 0, 0, 136, 0, 136, 136, 136, - 0, 0, 136, 0, 136, 0, 0, 136, 0, 0, - 136, 0, 136, 136, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 324, 0, 325, 0, - 0, 0, 136, 136, 0, 136, 136, 0, 0, 0, - 0, 136, 0, 0, 0, 0, 0, 0, 0, 136, + 51, 82, 54, 134, 66, 58, 185, 201, 133, 204, + 3, 140, 143, 64, 150, 161, 78, 20, 21, 79, + 130, 131, 160, 138, 142, 145, 147, 148, 255, 256, + 135, 49, 78, 63, 135, 79, 50, 83, 50, 50, + 268, 6, 84, 177, 180, 84, 182, 183, 184, 132, + 186, 187, 139, 271, 7, 149, 339, 316, 84, 340, + 14, 174, 84, 200, 8, 9, 10, 11, 12, 318, + 16, 208, 209, 17, 84, 213, 215, 321, 220, 252, + 45, 46, 84, 223, 202, 18, 205, 211, 214, 216, + 217, 218, 229, 231, 301, 222, 224, 53, 50, 225, + 236, 242, 7, 303, 227, 230, 232, 19, 241, 284, + 29, 81, 78, 30, 287, 79, 212, 45, 86, 219, + 31, 293, 34, 35, 32, 175, 176, 245, 36, 181, + 37, 38, 39, 228, 118, 233, 234, 45, 87, 248, + 45, 88, 40, 190, 191, 192, 89, 90, 261, 262, + 263, 59, 60, 61, 156, 157, 275, 233, 234, 156, + 237, 136, 280, 282, 335, 336, 41, 42, 274, 276, + 43, 277, 290, 44, 278, 281, 283, 52, 55, 286, + 62, 50, 72, 73, 289, 291, 285, 292, 74, 172, + 173, 288, 76, 178, 77, 85, 352, 353, 63, 178, + 135, 137, 141, 279, 144, 146, 152, 194, 195, 196, + 197, 198, 199, 151, 154, 159, 45, 162, 163, 206, + 164, 167, 168, 313, 169, 136, 188, 203, 207, 210, + 235, 311, 239, 136, 238, 312, 314, 136, 315, 240, + 136, 243, 136, 244, 267, 269, 320, 270, 324, 295, + 259, 272, 296, 294, 297, 298, 299, 302, 193, 309, + 310, 331, 317, 322, 323, 329, 319, 246, 247, 328, + 330, 251, 178, 325, 332, 253, 254, 338, 335, 257, + 334, 342, 258, 346, 343, 344, 347, 348, 350, 354, + 264, 265, 355, 165, 266, 341, 155, 15, 0, 0, + 0, 0, 0, 0, 273, 0, 136, 0, 0, 136, + 0, 136, 136, 0, 0, 351, 0, 136, 0, 136, + 136, 0, 136, 0, 0, 136, 0, 136, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 136, 0, 300, 0, 136, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 304, 305, 306, 307, 0, + 0, 308, 0, 0, 0, 0, 0, 0, 0, 136, + 0, 136, 136, 136, 0, 0, 136, 0, 136, 0, + 0, 136, 0, 0, 136, 0, 136, 136, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 326, 0, 327, 0, 0, 0, 136, 136, 0, 136, + 136, 0, 0, 0, 0, 136, 0, 0, 0, 0, + 0, 0, 0, 136, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 0, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 0, 0, 111, 112, 113, 114, + 115, 116, 117, 0, 118, 119, 120, 121, 0, 0, + 0, 0, 0, 0, 122, 123, 124, 125, 0, 0, + 0, 0, 0, 0, 126, 127, 128, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 0, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 0, 0, 111, + 112, 113, 114, 115, 116, 117, 0, 0, 221, 120, + 121, 0, 0, 0, 0, 0, 0, 122, 123, 124, + 125, 0, 0, 0, 0, 0, 0, 126, 127, 128, 92, 93, 94, 95, 96, 97, 98, 99, 100, 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, 0, 111, 112, 113, 114, 115, 116, 117, 0, - 118, 119, 120, 121, 0, 0, 0, 0, 0, 0, + 0, 119, 120, 121, 0, 0, 0, 0, 0, 0, 122, 123, 124, 125, 0, 0, 0, 0, 0, 0, 126, 127, 128, 92, 93, 94, 95, 96, 97, 98, 99, 100, 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, 0, 111, 112, 113, 114, 115, - 116, 117, 0, 0, 220, 120, 121, 0, 0, 0, + 116, 117, 0, 0, 0, 0, 121, 0, 0, 0, 0, 0, 0, 122, 123, 124, 125, 0, 0, 0, 0, 0, 0, 126, 127, 128, 92, 93, 94, 95, 96, 97, 98, 99, 100, 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, 0, 111, 112, - 113, 114, 115, 116, 117, 0, 0, 119, 120, 121, + 113, 114, 115, 116, 117, 0, 0, 0, 0, 226, 0, 0, 0, 0, 0, 0, 122, 123, 124, 125, 0, 0, 0, 0, 0, 0, 126, 127, 128, 92, 93, 94, 95, 96, 97, 98, 99, 100, 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, 0, 111, 112, 113, 114, 115, 116, 117, 0, 0, - 0, 0, 121, 0, 0, 0, 0, 0, 0, 122, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 123, 124, 125, 0, 0, 0, 0, 0, 0, 126, - 127, 128, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 0, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 0, 0, 111, 112, 113, 114, 115, 116, - 117, 0, 0, 0, 0, 225, 0, 0, 0, 0, - 0, 0, 122, 123, 124, 125, 0, 0, 0, 0, - 0, 0, 126, 127, 128, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 0, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 0, 0, 111, 112, 113, - 114, 115, 116, 117, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 122, 123, 124, 125, 0, - 0, 0, 0, 0, 0, 126, 127, 128 + 127, 128 }; static const yytype_int16 yycheck[] = { - 35, 56, 37, 64, 48, 40, 3, 119, 64, 121, - 104, 67, 68, 48, 70, 76, 0, 3, 3, 5, - 64, 64, 8, 67, 68, 69, 70, 70, 44, 182, - 3, 76, 96, 97, 5, 8, 100, 8, 54, 55, - 56, 57, 58, 98, 99, 3, 101, 102, 103, 64, - 105, 106, 67, 3, 3, 70, 4, 4, 8, 39, - 40, 9, 9, 118, 3, 45, 7, 47, 48, 49, - 7, 126, 127, 4, 5, 131, 132, 8, 134, 59, - 4, 44, 176, 139, 119, 9, 121, 131, 132, 133, - 134, 134, 148, 149, 247, 139, 140, 16, 4, 143, - 19, 162, 255, 9, 148, 149, 150, 4, 220, 154, - 174, 4, 9, 225, 3, 4, 131, 162, 4, 134, - 232, 3, 58, 9, 3, 4, 8, 171, 40, 41, - 42, 7, 8, 148, 108, 109, 110, 189, 190, 191, - 42, 43, 44, 3, 4, 3, 4, 3, 4, 58, - 5, 6, 3, 4, 58, 211, 41, 42, 7, 66, - 7, 217, 218, 3, 4, 3, 4, 211, 212, 5, - 214, 227, 7, 217, 218, 219, 7, 39, 222, 8, - 32, 3, 5, 227, 228, 220, 230, 94, 95, 7, - 225, 98, 7, 9, 3, 348, 349, 104, 3, 3, - 3, 3, 217, 3, 3, 112, 113, 114, 115, 116, - 117, 4, 39, 3, 3, 7, 4, 124, 4, 4, - 7, 277, 4, 130, 30, 9, 7, 4, 4, 273, - 4, 138, 46, 277, 278, 142, 280, 4, 145, 4, - 147, 4, 4, 9, 288, 4, 7, 4, 31, 9, - 4, 9, 5, 4, 4, 3, 334, 4, 4, 3, - 9, 4, 4, 4, 9, 172, 173, 311, 175, 176, - 49, 4, 179, 180, 4, 9, 183, 3, 42, 186, - 4, 4, 337, 338, 4, 3, 111, 194, 195, 4, - 19, 198, 4, -1, 74, 8, -1, -1, -1, -1, - -1, 208, -1, 210, -1, -1, 213, -1, 215, 216, - -1, 86, -1, 348, 221, -1, 223, 224, -1, 226, - -1, -1, 229, -1, 231, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 244, -1, 246, - -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, - -1, 258, 259, 260, 261, -1, -1, 264, -1, -1, - -1, -1, -1, -1, -1, 272, -1, 274, 275, 276, - -1, -1, 279, -1, 281, -1, -1, 284, -1, -1, - 287, -1, 289, 290, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 303, -1, 305, -1, - -1, -1, 309, 310, -1, 312, 313, -1, -1, -1, - -1, 318, -1, -1, -1, -1, -1, -1, -1, 326, + 35, 56, 37, 64, 48, 40, 104, 119, 64, 121, + 3, 67, 68, 48, 70, 76, 5, 3, 4, 8, + 64, 64, 76, 67, 68, 69, 70, 70, 182, 183, + 3, 3, 5, 3, 3, 8, 8, 4, 8, 8, + 4, 0, 9, 98, 99, 9, 101, 102, 103, 64, + 105, 106, 67, 4, 44, 70, 16, 4, 9, 19, + 3, 96, 9, 118, 54, 55, 56, 57, 58, 4, + 3, 126, 127, 3, 9, 131, 132, 4, 134, 177, + 3, 4, 9, 139, 119, 3, 121, 131, 132, 133, + 134, 134, 148, 149, 248, 139, 140, 7, 8, 143, + 154, 162, 44, 257, 148, 149, 150, 7, 162, 221, + 7, 4, 5, 58, 226, 8, 131, 3, 4, 134, + 58, 233, 39, 40, 58, 96, 97, 171, 45, 100, + 47, 48, 49, 148, 40, 41, 42, 3, 4, 174, + 3, 4, 59, 108, 109, 110, 5, 6, 190, 191, + 192, 42, 43, 44, 3, 4, 212, 41, 42, 3, + 4, 66, 218, 219, 3, 4, 4, 7, 212, 213, + 7, 215, 228, 7, 218, 219, 220, 5, 7, 223, + 32, 8, 39, 3, 228, 229, 221, 231, 5, 94, + 95, 226, 7, 98, 7, 9, 350, 351, 3, 104, + 3, 3, 3, 218, 3, 3, 3, 112, 113, 114, + 115, 116, 117, 4, 39, 3, 3, 7, 4, 124, + 4, 4, 7, 279, 4, 130, 30, 9, 7, 4, + 4, 275, 4, 138, 46, 279, 280, 142, 282, 4, + 145, 4, 147, 4, 4, 9, 290, 4, 7, 4, + 31, 9, 4, 9, 5, 4, 4, 3, 111, 4, + 4, 3, 9, 4, 4, 4, 9, 172, 173, 313, + 4, 176, 177, 49, 4, 180, 181, 9, 3, 184, + 42, 4, 187, 4, 339, 340, 4, 3, 19, 4, + 195, 196, 4, 86, 199, 336, 74, 8, -1, -1, + -1, -1, -1, -1, 209, -1, 211, -1, -1, 214, + -1, 216, 217, -1, -1, 350, -1, 222, -1, 224, + 225, -1, 227, -1, -1, 230, -1, 232, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 245, -1, 247, -1, 249, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 260, 261, 262, 263, -1, + -1, 266, -1, -1, -1, -1, -1, -1, -1, 274, + -1, 276, 277, 278, -1, -1, 281, -1, 283, -1, + -1, 286, -1, -1, 289, -1, 291, 292, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 305, -1, 307, -1, -1, -1, 311, 312, -1, 314, + 315, -1, -1, -1, -1, 320, -1, -1, -1, -1, + -1, -1, -1, 328, 10, 11, 12, 13, 14, 15, + 16, 17, 18, -1, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, -1, -1, 32, 33, 34, 35, + 36, 37, 38, -1, 40, 41, 42, 43, -1, -1, + -1, -1, -1, -1, 50, 51, 52, 53, -1, -1, + -1, -1, -1, -1, 60, 61, 62, 10, 11, 12, + 13, 14, 15, 16, 17, 18, -1, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, -1, -1, 32, + 33, 34, 35, 36, 37, 38, -1, -1, 41, 42, + 43, -1, -1, -1, -1, -1, -1, 50, 51, 52, + 53, -1, -1, -1, -1, -1, -1, 60, 61, 62, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, 32, 33, 34, 35, 36, 37, 38, -1, - 40, 41, 42, 43, -1, -1, -1, -1, -1, -1, + -1, 41, 42, 43, -1, -1, -1, -1, -1, -1, 50, 51, 52, 53, -1, -1, -1, -1, -1, -1, 60, 61, 62, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, 32, 33, 34, 35, 36, - 37, 38, -1, -1, 41, 42, 43, -1, -1, -1, + 37, 38, -1, -1, -1, -1, 43, -1, -1, -1, -1, -1, -1, 50, 51, 52, 53, -1, -1, -1, -1, -1, -1, 60, 61, 62, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, 32, 33, - 34, 35, 36, 37, 38, -1, -1, 41, 42, 43, + 34, 35, 36, 37, 38, -1, -1, -1, -1, 43, -1, -1, -1, -1, -1, -1, 50, 51, 52, 53, -1, -1, -1, -1, -1, -1, 60, 61, 62, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, 32, 33, 34, 35, 36, 37, 38, -1, -1, - -1, -1, 43, -1, -1, -1, -1, -1, -1, 50, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, 52, 53, -1, -1, -1, -1, -1, -1, 60, - 61, 62, 10, 11, 12, 13, 14, 15, 16, 17, - 18, -1, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, -1, -1, 32, 33, 34, 35, 36, 37, - 38, -1, -1, -1, -1, 43, -1, -1, -1, -1, - -1, -1, 50, 51, 52, 53, -1, -1, -1, -1, - -1, -1, 60, 61, 62, 10, 11, 12, 13, 14, - 15, 16, 17, 18, -1, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, -1, -1, 32, 33, 34, - 35, 36, 37, 38, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 50, 51, 52, 53, -1, - -1, -1, -1, -1, -1, 60, 61, 62 + 61, 62 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -914,25 +916,25 @@ static const yytype_uint8 yystos[] = 85, 3, 77, 85, 3, 77, 3, 77, 83, 84, 85, 4, 3, 66, 39, 91, 3, 4, 90, 3, 66, 86, 7, 4, 4, 102, 103, 4, 7, 4, - 70, 71, 74, 74, 71, 71, 68, 74, 76, 68, - 71, 68, 68, 68, 76, 68, 68, 30, 72, 72, - 72, 72, 67, 74, 74, 74, 74, 74, 74, 68, - 65, 70, 9, 65, 70, 74, 7, 68, 68, 4, - 77, 84, 85, 77, 85, 77, 77, 83, 84, 85, - 41, 77, 85, 77, 77, 43, 77, 84, 85, 77, - 85, 77, 41, 42, 4, 66, 4, 46, 4, 4, - 66, 86, 4, 4, 77, 74, 74, 71, 74, 76, - 74, 74, 77, 78, 78, 74, 74, 31, 73, 73, - 73, 73, 74, 74, 74, 4, 4, 9, 4, 4, - 9, 74, 77, 85, 77, 77, 77, 84, 85, 77, - 85, 77, 65, 70, 77, 65, 70, 77, 85, 77, - 77, 65, 9, 4, 4, 5, 4, 4, 74, 78, - 3, 78, 74, 74, 74, 74, 74, 4, 4, 77, - 77, 85, 77, 77, 4, 9, 4, 9, 77, 4, - 4, 4, 7, 49, 74, 74, 77, 4, 4, 3, - 4, 80, 42, 3, 4, 79, 9, 16, 19, 79, - 4, 68, 68, 82, 4, 4, 3, 81, 19, 70, - 78, 78, 4, 4 + 70, 71, 74, 74, 70, 71, 71, 68, 74, 76, + 68, 71, 68, 68, 68, 76, 68, 68, 30, 72, + 72, 72, 72, 67, 74, 74, 74, 74, 74, 74, + 68, 65, 70, 9, 65, 70, 74, 7, 68, 68, + 4, 77, 84, 85, 77, 85, 77, 77, 83, 84, + 85, 41, 77, 85, 77, 77, 43, 77, 84, 85, + 77, 85, 77, 41, 42, 4, 66, 4, 46, 4, + 4, 66, 86, 4, 4, 77, 74, 74, 70, 77, + 78, 74, 76, 74, 74, 78, 78, 74, 74, 31, + 73, 73, 73, 73, 74, 74, 74, 4, 4, 9, + 4, 4, 9, 74, 77, 85, 77, 77, 77, 84, + 85, 77, 85, 77, 65, 70, 77, 65, 70, 77, + 85, 77, 77, 65, 9, 4, 4, 5, 4, 4, + 74, 78, 3, 78, 74, 74, 74, 74, 74, 4, + 4, 77, 77, 85, 77, 77, 4, 9, 4, 9, + 77, 4, 4, 4, 7, 49, 74, 74, 77, 4, + 4, 3, 4, 80, 42, 3, 4, 79, 9, 16, + 19, 79, 4, 68, 68, 82, 4, 4, 3, 81, + 19, 70, 78, 78, 4, 4 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -943,20 +945,20 @@ static const yytype_uint8 yyr1[] = 73, 74, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 76, 76, 77, - 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, - 82, 83, 83, 83, 83, 84, 85, 85, 85, 85, - 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, + 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, + 82, 82, 83, 83, 83, 83, 84, 85, 85, 85, + 85, 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 89, 88, 90, 91, 91, - 92, 92, 93, 93, 94, 95, 95, 95, 95, 96, - 97, 97, 98, 98, 98, 98, 98, 98, 98, 98, - 99, 100, 100, 100, 100, 100, 100, 101, 101, 102, - 103, 103, 104, 104, 105 + 87, 87, 87, 87, 87, 87, 89, 88, 90, 91, + 91, 92, 92, 93, 93, 94, 95, 95, 95, 95, + 96, 97, 97, 98, 98, 98, 98, 98, 98, 98, + 98, 99, 100, 100, 100, 100, 100, 100, 101, 101, + 102, 103, 103, 104, 104, 105 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -964,23 +966,23 @@ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 0, 4, 8, 4, 1, 1, 1, 1, 0, 2, 1, 0, 1, 0, 1, 0, - 1, 3, 1, 2, 3, 4, 3, 3, 4, 3, - 2, 3, 2, 9, 3, 3, 4, 2, 3, 4, - 5, 4, 5, 2, 2, 3, 4, 3, 2, 2, - 1, 1, 2, 2, 2, 3, 1, 0, 1, 1, - 2, 0, 1, 4, 4, 0, 2, 4, 5, 0, - 2, 4, 5, 5, 6, 4, 4, 5, 5, 6, - 4, 0, 1, 2, 3, 4, 5, 6, 5, 4, - 5, 4, 3, 4, 5, 4, 3, 4, 3, 2, - 3, 2, 3, 4, 5, 4, 3, 4, 3, 2, - 3, 4, 3, 2, 1, 2, 3, 4, 5, 4, - 3, 4, 3, 2, 3, 4, 3, 2, 3, 2, - 1, 2, 3, 4, 3, 2, 3, 2, 1, 2, - 3, 2, 1, 2, 1, 0, 5, 5, 0, 2, - 6, 5, 7, 8, 4, 6, 7, 6, 7, 5, - 4, 5, 0, 2, 2, 2, 2, 2, 2, 2, - 4, 1, 5, 5, 9, 8, 9, 0, 2, 4, - 0, 1, 0, 2, 1 + 1, 3, 1, 2, 3, 4, 3, 3, 3, 4, + 3, 2, 3, 2, 9, 3, 3, 4, 2, 3, + 4, 5, 4, 5, 2, 2, 3, 4, 3, 2, + 2, 1, 1, 2, 2, 2, 3, 1, 0, 1, + 1, 2, 0, 1, 4, 4, 0, 2, 4, 5, + 0, 2, 4, 5, 5, 6, 4, 4, 5, 5, + 6, 4, 0, 1, 2, 3, 4, 5, 6, 5, + 4, 5, 4, 3, 4, 5, 4, 3, 4, 3, + 2, 3, 2, 3, 4, 5, 4, 3, 4, 3, + 2, 3, 4, 3, 2, 1, 2, 3, 4, 5, + 4, 3, 4, 3, 2, 3, 4, 3, 2, 3, + 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, + 2, 3, 2, 1, 2, 1, 0, 5, 5, 0, + 2, 6, 5, 7, 8, 4, 6, 7, 6, 7, + 5, 4, 5, 0, 2, 2, 2, 2, 2, 2, + 2, 4, 1, 5, 5, 9, 8, 9, 0, 2, + 4, 0, 1, 0, 2, 1 }; @@ -1762,19 +1764,19 @@ yyreduce: case 2: #line 136 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.types)); } -#line 1766 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1768 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 3: #line 137 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.types) = (yyvsp[-1].types); *wasm_append_type(&(yyval.types)) = (yyvsp[0].type); } -#line 1772 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1774 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 4: #line 140 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.func_sig)); } -#line 1778 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1780 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 5: @@ -1783,7 +1785,7 @@ yyreduce: (yyval.func_sig).result_type = WASM_TYPE_VOID; (yyval.func_sig).param_types = (yyvsp[-1].types); } -#line 1787 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1789 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 6: @@ -1792,25 +1794,25 @@ yyreduce: (yyval.func_sig).result_type = (yyvsp[-1].type); (yyval.func_sig).param_types = (yyvsp[-5].types); } -#line 1796 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1798 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 7: #line 149 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func_sig).result_type = (yyvsp[-1].type); } -#line 1802 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1804 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 8: #line 156 "src/wasm-parser.y" /* yacc.c:1646 */ { DUPTEXT((yyval.text), (yyvsp[0].text)); } -#line 1808 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1810 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 9: #line 157 "src/wasm-parser.y" /* yacc.c:1646 */ { DUPTEXT((yyval.text), (yyvsp[0].text)); } -#line 1814 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1816 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 10: @@ -1823,7 +1825,7 @@ yyreduce: yyerror(&(yylsp[0]), scanner, parser, "invalid int %.*s", (yyvsp[0].text).length, (yyvsp[0].text).start); (yyval.var).index = index; } -#line 1827 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1829 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 11: @@ -1833,43 +1835,43 @@ yyreduce: (yyval.var).type = WASM_VAR_TYPE_NAME; DUPTEXT((yyval.var).name, (yyvsp[0].text)); } -#line 1837 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1839 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 12: #line 176 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.vars)); } -#line 1843 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1845 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 13: #line 177 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.vars) = (yyvsp[-1].vars); *wasm_append_var(&(yyval.vars)) = (yyvsp[0].var); } -#line 1849 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1851 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 14: #line 180 "src/wasm-parser.y" /* yacc.c:1646 */ { DUPTEXT((yyval.text), (yyvsp[0].text)); } -#line 1855 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1857 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 15: #line 184 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.text)); } -#line 1861 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1863 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 16: #line 185 "src/wasm-parser.y" /* yacc.c:1646 */ { DUPTEXT((yyval.text), (yyvsp[0].text)); } -#line 1867 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1869 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 17: #line 189 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.u32) = 0; } -#line 1873 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1875 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 18: @@ -1879,13 +1881,13 @@ yyreduce: yyerror(&(yylsp[0]), scanner, parser, "invalid offset \"%.*s\"", (yyvsp[0].text).length, (yyvsp[0].text).start); } -#line 1883 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1885 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 19: #line 197 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.u32) = 0; } -#line 1889 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1891 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 20: @@ -1898,19 +1900,19 @@ yyreduce: if (!is_power_of_two((yyval.u32))) yyerror(&(yylsp[0]), scanner, parser, "alignment must be power-of-two"); } -#line 1902 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1904 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 21: #line 209 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[-1].expr); (yyval.expr)->loc = (yylsp[-2]); } -#line 1908 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1910 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 22: #line 212 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_NOP); } -#line 1914 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1916 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 23: @@ -1919,7 +1921,7 @@ yyreduce: (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_BLOCK); (yyval.expr)->block.label = (yyvsp[0].text); } -#line 1923 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1925 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 24: @@ -1929,7 +1931,7 @@ yyreduce: (yyval.expr)->block.label = (yyvsp[-1].text); (yyval.expr)->block.exprs = (yyvsp[0].exprs); } -#line 1933 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1935 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 25: @@ -1940,7 +1942,7 @@ yyreduce: (yyval.expr)->if_else.true_ = (yyvsp[-1].expr); (yyval.expr)->if_else.false_ = (yyvsp[0].expr); } -#line 1944 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1946 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 26: @@ -1950,7 +1952,7 @@ yyreduce: (yyval.expr)->if_else.cond = (yyvsp[-1].expr); (yyval.expr)->if_else.true_ = (yyvsp[0].expr); } -#line 1954 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1956 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 27: @@ -1960,32 +1962,43 @@ yyreduce: (yyval.expr)->br_if.var = (yyvsp[-1].var); (yyval.expr)->br_if.cond = (yyvsp[0].expr); } -#line 1964 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1966 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 28: #line 238 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_LOOP); - (yyval.expr)->loop.outer = (yyvsp[-2].text); + ZEROMEM((yyval.expr)->loop.outer); (yyval.expr)->loop.inner = (yyvsp[-1].text); (yyval.expr)->loop.exprs = (yyvsp[0].exprs); } -#line 1975 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1977 "src/wasm-parser.c" /* yacc.c:1646 */ break; case 29: #line 244 "src/wasm-parser.y" /* yacc.c:1646 */ { + (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_LOOP); + (yyval.expr)->loop.outer = (yyvsp[-2].text); + (yyval.expr)->loop.inner = (yyvsp[-1].text); + (yyval.expr)->loop.exprs = (yyvsp[0].exprs); + } +#line 1988 "src/wasm-parser.c" /* yacc.c:1646 */ + break; + + case 30: +#line 250 "src/wasm-parser.y" /* yacc.c:1646 */ + { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_LABEL); (yyval.expr)->label.label = (yyvsp[-1].text); (yyval.expr)->label.expr = (yyvsp[0].expr); } -#line 1985 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 1998 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 30: -#line 249 "src/wasm-parser.y" /* yacc.c:1646 */ + case 31: +#line 255 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_BR); (yyval.expr)->br.var.loc = (yylsp[-1]); @@ -1993,30 +2006,30 @@ yyreduce: (yyval.expr)->br.var.index = 0; (yyval.expr)->br.expr = (yyvsp[0].expr); } -#line 1997 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2010 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 31: -#line 256 "src/wasm-parser.y" /* yacc.c:1646 */ + case 32: +#line 262 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_BR); (yyval.expr)->br.var = (yyvsp[-1].var); (yyval.expr)->br.expr = (yyvsp[0].expr); } -#line 2007 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2020 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 32: -#line 261 "src/wasm-parser.y" /* yacc.c:1646 */ + case 33: +#line 267 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_RETURN); (yyval.expr)->return_.expr = (yyvsp[0].expr); } -#line 2016 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2029 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 33: -#line 265 "src/wasm-parser.y" /* yacc.c:1646 */ + case 34: +#line 271 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_TABLESWITCH); (yyval.expr)->tableswitch.label = (yyvsp[-7].text); @@ -2037,61 +2050,61 @@ yyreduce: } } } -#line 2041 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2054 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 34: -#line 285 "src/wasm-parser.y" /* yacc.c:1646 */ + case 35: +#line 291 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_CALL); (yyval.expr)->call.var = (yyvsp[-1].var); (yyval.expr)->call.args = (yyvsp[0].exprs); } -#line 2051 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2064 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 35: -#line 290 "src/wasm-parser.y" /* yacc.c:1646 */ + case 36: +#line 296 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_CALL_IMPORT); (yyval.expr)->call.var = (yyvsp[-1].var); (yyval.expr)->call.args = (yyvsp[0].exprs); } -#line 2061 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2074 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 36: -#line 295 "src/wasm-parser.y" /* yacc.c:1646 */ + case 37: +#line 301 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_CALL_INDIRECT); (yyval.expr)->call_indirect.var = (yyvsp[-2].var); (yyval.expr)->call_indirect.expr = (yyvsp[-1].expr); (yyval.expr)->call_indirect.args = (yyvsp[0].exprs); } -#line 2072 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2085 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 37: -#line 301 "src/wasm-parser.y" /* yacc.c:1646 */ + case 38: +#line 307 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_GET_LOCAL); (yyval.expr)->get_local.var = (yyvsp[0].var); } -#line 2081 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2094 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 38: -#line 305 "src/wasm-parser.y" /* yacc.c:1646 */ + case 39: +#line 311 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_SET_LOCAL); (yyval.expr)->set_local.var = (yyvsp[-1].var); (yyval.expr)->set_local.expr = (yyvsp[0].expr); } -#line 2091 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2104 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 39: -#line 310 "src/wasm-parser.y" /* yacc.c:1646 */ + case 40: +#line 316 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_LOAD); (yyval.expr)->load.op = (yyvsp[-3].mem); @@ -2099,11 +2112,11 @@ yyreduce: (yyval.expr)->load.align = (yyvsp[-1].u32); (yyval.expr)->load.addr = (yyvsp[0].expr); } -#line 2103 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2116 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 40: -#line 317 "src/wasm-parser.y" /* yacc.c:1646 */ + case 41: +#line 323 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_STORE); (yyval.expr)->store.op = (yyvsp[-4].mem); @@ -2112,11 +2125,11 @@ yyreduce: (yyval.expr)->store.addr = (yyvsp[-1].expr); (yyval.expr)->store.value = (yyvsp[0].expr); } -#line 2116 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2129 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 41: -#line 325 "src/wasm-parser.y" /* yacc.c:1646 */ + case 42: +#line 331 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_LOAD_EXTEND); (yyval.expr)->load.op = (yyvsp[-3].mem); @@ -2124,11 +2137,11 @@ yyreduce: (yyval.expr)->load.align = (yyvsp[-1].u32); (yyval.expr)->load.addr = (yyvsp[0].expr); } -#line 2128 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2141 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 42: -#line 332 "src/wasm-parser.y" /* yacc.c:1646 */ + case 43: +#line 338 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_STORE_WRAP); (yyval.expr)->store.op = (yyvsp[-4].mem); @@ -2137,11 +2150,11 @@ yyreduce: (yyval.expr)->store.addr = (yyvsp[-1].expr); (yyval.expr)->store.value = (yyvsp[0].expr); } -#line 2141 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2154 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 43: -#line 340 "src/wasm-parser.y" /* yacc.c:1646 */ + case 44: +#line 346 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_CONST); (yyval.expr)->const_.loc = (yylsp[-1]); @@ -2150,32 +2163,32 @@ yyreduce: (yyvsp[0].text).start); free((char*)(yyvsp[0].text).start); } -#line 2154 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2167 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 44: -#line 348 "src/wasm-parser.y" /* yacc.c:1646 */ + case 45: +#line 354 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_UNARY); (yyval.expr)->unary.op = (yyvsp[-1].unary); (yyval.expr)->unary.expr = (yyvsp[0].expr); } -#line 2164 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2177 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 45: -#line 353 "src/wasm-parser.y" /* yacc.c:1646 */ + case 46: +#line 359 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_BINARY); (yyval.expr)->binary.op = (yyvsp[-2].binary); (yyval.expr)->binary.left = (yyvsp[-1].expr); (yyval.expr)->binary.right = (yyvsp[0].expr); } -#line 2175 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2188 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 46: -#line 359 "src/wasm-parser.y" /* yacc.c:1646 */ + case 47: +#line 365 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_SELECT); (yyval.expr)->select.type = (yyvsp[-3].type); @@ -2183,185 +2196,185 @@ yyreduce: (yyval.expr)->select.true_ = (yyvsp[-1].expr); (yyval.expr)->select.false_ = (yyvsp[0].expr); } -#line 2187 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2200 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 47: -#line 366 "src/wasm-parser.y" /* yacc.c:1646 */ + case 48: +#line 372 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_COMPARE); (yyval.expr)->compare.op = (yyvsp[-2].compare); (yyval.expr)->compare.left = (yyvsp[-1].expr); (yyval.expr)->compare.right = (yyvsp[0].expr); } -#line 2198 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2211 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 48: -#line 372 "src/wasm-parser.y" /* yacc.c:1646 */ + case 49: +#line 378 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_CONVERT); (yyval.expr)->convert.op = (yyvsp[-1].convert); (yyval.expr)->convert.expr = (yyvsp[0].expr); } -#line 2208 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2221 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 49: -#line 377 "src/wasm-parser.y" /* yacc.c:1646 */ + case 50: +#line 383 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_CAST); (yyval.expr)->cast.op = (yyvsp[-1].cast); (yyval.expr)->cast.expr = (yyvsp[0].expr); } -#line 2218 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2231 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 50: -#line 382 "src/wasm-parser.y" /* yacc.c:1646 */ + case 51: +#line 388 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_UNREACHABLE); } -#line 2224 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2237 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 51: -#line 383 "src/wasm-parser.y" /* yacc.c:1646 */ + case 52: +#line 389 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_MEMORY_SIZE); } -#line 2230 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2243 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 52: -#line 384 "src/wasm-parser.y" /* yacc.c:1646 */ + case 53: +#line 390 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_GROW_MEMORY); (yyval.expr)->grow_memory.expr = (yyvsp[0].expr); } -#line 2239 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2252 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 53: -#line 388 "src/wasm-parser.y" /* yacc.c:1646 */ + case 54: +#line 394 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_HAS_FEATURE); (yyval.expr)->has_feature.text = (yyvsp[0].text); } -#line 2248 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2261 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 54: -#line 392 "src/wasm-parser.y" /* yacc.c:1646 */ + case 55: +#line 398 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_LOAD_GLOBAL); (yyval.expr)->load_global.var = (yyvsp[0].var); } -#line 2257 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2270 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 55: -#line 396 "src/wasm-parser.y" /* yacc.c:1646 */ + case 56: +#line 402 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_STORE_GLOBAL); (yyval.expr)->store_global.var = (yyvsp[-1].var); (yyval.expr)->store_global.expr = (yyvsp[0].expr); } -#line 2267 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2280 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 56: -#line 401 "src/wasm-parser.y" /* yacc.c:1646 */ + case 57: +#line 407 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_expr(WASM_EXPR_TYPE_PAGE_SIZE); } -#line 2273 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2286 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 57: -#line 404 "src/wasm-parser.y" /* yacc.c:1646 */ + case 58: +#line 410 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.expr) = NULL; } -#line 2279 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2292 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 59: -#line 408 "src/wasm-parser.y" /* yacc.c:1646 */ + case 60: +#line 414 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.exprs)); *wasm_append_expr_ptr(&(yyval.exprs)) = (yyvsp[0].expr); } -#line 2285 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2298 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 60: -#line 409 "src/wasm-parser.y" /* yacc.c:1646 */ + case 61: +#line 415 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.exprs) = (yyvsp[-1].exprs); *wasm_append_expr_ptr(&(yyval.exprs)) = (yyvsp[0].expr); } -#line 2291 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2304 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 61: -#line 412 "src/wasm-parser.y" /* yacc.c:1646 */ + case 62: +#line 418 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.exprs)); } -#line 2297 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2310 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 63: -#line 417 "src/wasm-parser.y" /* yacc.c:1646 */ + case 64: +#line 423 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.target).type = WASM_TARGET_TYPE_CASE; (yyval.target).var = (yyvsp[-1].var); } -#line 2306 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2319 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 64: -#line 421 "src/wasm-parser.y" /* yacc.c:1646 */ + case 65: +#line 427 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.target).type = WASM_TARGET_TYPE_BR; (yyval.target).var = (yyvsp[-1].var); } -#line 2315 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2328 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 65: -#line 427 "src/wasm-parser.y" /* yacc.c:1646 */ + case 66: +#line 433 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.targets)); } -#line 2321 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2334 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 66: -#line 428 "src/wasm-parser.y" /* yacc.c:1646 */ + case 67: +#line 434 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.targets) = (yyvsp[-1].targets); *wasm_append_target(&(yyval.targets)) = (yyvsp[0].target); } -#line 2327 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2340 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 67: -#line 431 "src/wasm-parser.y" /* yacc.c:1646 */ + case 68: +#line 437 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.case_).label); (yyval.case_).exprs = (yyvsp[-1].exprs); } -#line 2333 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2346 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 68: -#line 432 "src/wasm-parser.y" /* yacc.c:1646 */ + case 69: +#line 438 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.case_).label = (yyvsp[-2].text); (yyval.case_).exprs = (yyvsp[-1].exprs); } -#line 2339 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2352 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 69: -#line 435 "src/wasm-parser.y" /* yacc.c:1646 */ + case 70: +#line 441 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.cases)); } -#line 2345 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2358 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 70: -#line 436 "src/wasm-parser.y" /* yacc.c:1646 */ + case 71: +#line 442 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.cases) = (yyvsp[-1].cases); *wasm_append_case(&(yyval.cases)) = (yyvsp[0].case_); } -#line 2351 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2364 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 71: -#line 443 "src/wasm-parser.y" /* yacc.c:1646 */ + case 72: +#line 449 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.type_bindings)); wasm_extend_types(&(yyval.type_bindings).types, &(yyvsp[-1].types)); wasm_destroy_type_vector(&(yyvsp[-1].types)); } -#line 2361 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2374 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 72: -#line 448 "src/wasm-parser.y" /* yacc.c:1646 */ + case 73: +#line 454 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.type_bindings)); WasmBinding* binding = wasm_append_binding(&(yyval.type_bindings).bindings); @@ -2370,21 +2383,21 @@ yyreduce: binding->index = (yyval.type_bindings).types.size; *wasm_append_type(&(yyval.type_bindings).types) = (yyvsp[-1].type); } -#line 2374 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2387 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 73: -#line 456 "src/wasm-parser.y" /* yacc.c:1646 */ + case 74: +#line 462 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.type_bindings) = (yyvsp[-4].type_bindings); wasm_extend_types(&(yyval.type_bindings).types, &(yyvsp[-1].types)); wasm_destroy_type_vector(&(yyvsp[-1].types)); } -#line 2384 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2397 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 74: -#line 461 "src/wasm-parser.y" /* yacc.c:1646 */ + case 75: +#line 467 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.type_bindings) = (yyvsp[-5].type_bindings); WasmBinding* binding = wasm_append_binding(&(yyval.type_bindings).bindings); @@ -2393,27 +2406,27 @@ yyreduce: binding->index = (yyval.type_bindings).types.size; *wasm_append_type(&(yyval.type_bindings).types) = (yyvsp[-1].type); } -#line 2397 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2410 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 75: -#line 471 "src/wasm-parser.y" /* yacc.c:1646 */ + case 76: +#line 477 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.type) = (yyvsp[-1].type); } -#line 2403 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2416 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 76: -#line 474 "src/wasm-parser.y" /* yacc.c:1646 */ + case 77: +#line 480 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.type_bindings)); wasm_extend_types(&(yyval.type_bindings).types, &(yyvsp[-1].types)); wasm_destroy_type_vector(&(yyvsp[-1].types)); } -#line 2413 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2426 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 77: -#line 479 "src/wasm-parser.y" /* yacc.c:1646 */ + case 78: +#line 485 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.type_bindings)); WasmBinding* binding = wasm_append_binding(&(yyval.type_bindings).bindings); @@ -2422,21 +2435,21 @@ yyreduce: binding->index = (yyval.type_bindings).types.size; *wasm_append_type(&(yyval.type_bindings).types) = (yyvsp[-1].type); } -#line 2426 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2439 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 78: -#line 487 "src/wasm-parser.y" /* yacc.c:1646 */ + case 79: +#line 493 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.type_bindings) = (yyvsp[-4].type_bindings); wasm_extend_types(&(yyval.type_bindings).types, &(yyvsp[-1].types)); wasm_destroy_type_vector(&(yyvsp[-1].types)); } -#line 2436 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2449 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 79: -#line 492 "src/wasm-parser.y" /* yacc.c:1646 */ + case 80: +#line 498 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.type_bindings) = (yyvsp[-5].type_bindings); WasmBinding* binding = wasm_append_binding(&(yyval.type_bindings).bindings); @@ -2445,53 +2458,55 @@ yyreduce: binding->index = (yyval.type_bindings).types.size; *wasm_append_type(&(yyval.type_bindings).types) = (yyvsp[-1].type); } -#line 2449 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2462 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 80: -#line 502 "src/wasm-parser.y" /* yacc.c:1646 */ + case 81: +#line 508 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.var) = (yyvsp[-1].var); } -#line 2455 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2468 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 81: -#line 505 "src/wasm-parser.y" /* yacc.c:1646 */ - {} -#line 2461 "src/wasm-parser.c" /* yacc.c:1646 */ + case 82: +#line 511 "src/wasm-parser.y" /* yacc.c:1646 */ + { + (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; + } +#line 2476 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 82: -#line 506 "src/wasm-parser.y" /* yacc.c:1646 */ + case 83: +#line 514 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[0].text); } -#line 2470 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2485 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 83: -#line 510 "src/wasm-parser.y" /* yacc.c:1646 */ + case 84: +#line 518 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE; (yyval.func).name = (yyvsp[-1].text); (yyval.func).type_var = (yyvsp[0].var); } -#line 2480 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2495 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 84: -#line 515 "src/wasm-parser.y" /* yacc.c:1646 */ + case 85: +#line 523 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-2].text); (yyval.func).type_var = (yyvsp[-1].var); (yyval.func).params = (yyvsp[0].type_bindings); } -#line 2491 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2506 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 85: -#line 521 "src/wasm-parser.y" /* yacc.c:1646 */ + case 86: +#line 529 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-3].text); @@ -2499,11 +2514,11 @@ yyreduce: (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).result_type = (yyvsp[0].type); } -#line 2503 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2518 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 86: -#line 528 "src/wasm-parser.y" /* yacc.c:1646 */ + case 87: +#line 536 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-4].text); @@ -2512,11 +2527,11 @@ yyreduce: (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2516 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2531 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 87: -#line 536 "src/wasm-parser.y" /* yacc.c:1646 */ + case 88: +#line 544 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-5].text); @@ -2526,11 +2541,11 @@ yyreduce: (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2530 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2545 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 88: -#line 545 "src/wasm-parser.y" /* yacc.c:1646 */ + case 89: +#line 553 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-4].text); @@ -2539,11 +2554,11 @@ yyreduce: (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2543 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2558 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 89: -#line 553 "src/wasm-parser.y" /* yacc.c:1646 */ + case 90: +#line 561 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-3].text); @@ -2551,11 +2566,11 @@ yyreduce: (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2555 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2570 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 90: -#line 560 "src/wasm-parser.y" /* yacc.c:1646 */ + case 91: +#line 568 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-4].text); @@ -2563,11 +2578,11 @@ yyreduce: (yyval.func).params = (yyvsp[-2].type_bindings); (yyval.func).locals = (yyvsp[-1].type_bindings); } -#line 2567 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2582 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 91: -#line 567 "src/wasm-parser.y" /* yacc.c:1646 */ + case 92: +#line 575 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-3].text); @@ -2575,22 +2590,22 @@ yyreduce: (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2579 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2594 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 92: -#line 574 "src/wasm-parser.y" /* yacc.c:1646 */ + case 93: +#line 582 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-2].text); (yyval.func).type_var = (yyvsp[-1].var); (yyval.func).result_type = (yyvsp[0].type); } -#line 2590 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2605 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 93: -#line 580 "src/wasm-parser.y" /* yacc.c:1646 */ + case 94: +#line 588 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-3].text); @@ -2598,11 +2613,11 @@ yyreduce: (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2602 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2617 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 94: -#line 587 "src/wasm-parser.y" /* yacc.c:1646 */ + case 95: +#line 595 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-4].text); @@ -2611,11 +2626,11 @@ yyreduce: (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2615 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2630 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 95: -#line 595 "src/wasm-parser.y" /* yacc.c:1646 */ + case 96: +#line 603 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-3].text); @@ -2623,22 +2638,22 @@ yyreduce: (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2627 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2642 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 96: -#line 602 "src/wasm-parser.y" /* yacc.c:1646 */ + case 97: +#line 610 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE; (yyval.func).name = (yyvsp[-2].text); (yyval.func).type_var = (yyvsp[-1].var); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2638 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2653 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 97: -#line 608 "src/wasm-parser.y" /* yacc.c:1646 */ + case 98: +#line 616 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE; (yyval.func).name = (yyvsp[-3].text); @@ -2646,64 +2661,64 @@ yyreduce: (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2650 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2665 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 98: -#line 615 "src/wasm-parser.y" /* yacc.c:1646 */ + case 99: +#line 623 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE; (yyval.func).name = (yyvsp[-2].text); (yyval.func).type_var = (yyvsp[-1].var); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2661 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2676 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 99: -#line 621 "src/wasm-parser.y" /* yacc.c:1646 */ + case 100: +#line 629 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-1].text); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2671 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2686 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 100: -#line 626 "src/wasm-parser.y" /* yacc.c:1646 */ + case 101: +#line 634 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-2].text); (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2682 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2697 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 101: -#line 632 "src/wasm-parser.y" /* yacc.c:1646 */ + case 102: +#line 640 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-1].text); (yyval.func).params = (yyvsp[0].type_bindings); } -#line 2692 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2707 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 102: -#line 637 "src/wasm-parser.y" /* yacc.c:1646 */ + case 103: +#line 645 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-2].text); (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).result_type = (yyvsp[0].type); } -#line 2703 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2718 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 103: -#line 643 "src/wasm-parser.y" /* yacc.c:1646 */ + case 104: +#line 651 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-3].text); @@ -2711,11 +2726,11 @@ yyreduce: (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2715 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2730 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 104: -#line 650 "src/wasm-parser.y" /* yacc.c:1646 */ + case 105: +#line 658 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-4].text); @@ -2724,11 +2739,11 @@ yyreduce: (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2728 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2743 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 105: -#line 658 "src/wasm-parser.y" /* yacc.c:1646 */ + case 106: +#line 666 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-3].text); @@ -2736,22 +2751,22 @@ yyreduce: (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2740 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2755 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 106: -#line 665 "src/wasm-parser.y" /* yacc.c:1646 */ + case 107: +#line 673 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-2].text); (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2751 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2766 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 107: -#line 671 "src/wasm-parser.y" /* yacc.c:1646 */ + case 108: +#line 679 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-3].text); @@ -2759,43 +2774,43 @@ yyreduce: (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2763 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2778 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 108: -#line 678 "src/wasm-parser.y" /* yacc.c:1646 */ + case 109: +#line 686 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-2].text); (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2774 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2789 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 109: -#line 684 "src/wasm-parser.y" /* yacc.c:1646 */ + case 110: +#line 692 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-1].text); (yyval.func).result_type = (yyvsp[0].type); } -#line 2784 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2799 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 110: -#line 689 "src/wasm-parser.y" /* yacc.c:1646 */ + case 111: +#line 697 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-2].text); (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2795 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2810 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 111: -#line 695 "src/wasm-parser.y" /* yacc.c:1646 */ + case 112: +#line 703 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-3].text); @@ -2803,62 +2818,62 @@ yyreduce: (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2807 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2822 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 112: -#line 702 "src/wasm-parser.y" /* yacc.c:1646 */ + case 113: +#line 710 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-2].text); (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2818 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2833 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 113: -#line 708 "src/wasm-parser.y" /* yacc.c:1646 */ + case 114: +#line 716 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).name = (yyvsp[-1].text); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2828 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2843 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 114: -#line 713 "src/wasm-parser.y" /* yacc.c:1646 */ + case 115: +#line 721 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE; (yyval.func).type_var = (yyvsp[0].var); } -#line 2837 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2852 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 115: -#line 717 "src/wasm-parser.y" /* yacc.c:1646 */ + case 116: +#line 725 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-1].var); (yyval.func).params = (yyvsp[0].type_bindings); } -#line 2847 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2862 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 116: -#line 722 "src/wasm-parser.y" /* yacc.c:1646 */ + case 117: +#line 730 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-2].var); (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).result_type = (yyvsp[0].type); } -#line 2858 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2873 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 117: -#line 728 "src/wasm-parser.y" /* yacc.c:1646 */ + case 118: +#line 736 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-3].var); @@ -2866,11 +2881,11 @@ yyreduce: (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2870 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2885 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 118: -#line 735 "src/wasm-parser.y" /* yacc.c:1646 */ + case 119: +#line 743 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-4].var); @@ -2879,11 +2894,11 @@ yyreduce: (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2883 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2898 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 119: -#line 743 "src/wasm-parser.y" /* yacc.c:1646 */ + case 120: +#line 751 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-3].var); @@ -2891,22 +2906,22 @@ yyreduce: (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2895 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2910 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 120: -#line 750 "src/wasm-parser.y" /* yacc.c:1646 */ + case 121: +#line 758 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-2].var); (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2906 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2921 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 121: -#line 756 "src/wasm-parser.y" /* yacc.c:1646 */ + case 122: +#line 764 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-3].var); @@ -2914,43 +2929,43 @@ yyreduce: (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2918 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2933 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 122: -#line 763 "src/wasm-parser.y" /* yacc.c:1646 */ + case 123: +#line 771 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-2].var); (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2929 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2944 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 123: -#line 769 "src/wasm-parser.y" /* yacc.c:1646 */ + case 124: +#line 777 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-1].var); (yyval.func).result_type = (yyvsp[0].type); } -#line 2939 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2954 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 124: -#line 774 "src/wasm-parser.y" /* yacc.c:1646 */ + case 125: +#line 782 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-2].var); (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2950 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2965 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 125: -#line 780 "src/wasm-parser.y" /* yacc.c:1646 */ + case 126: +#line 788 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-3].var); @@ -2958,83 +2973,83 @@ yyreduce: (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2962 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2977 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 126: -#line 787 "src/wasm-parser.y" /* yacc.c:1646 */ + case 127: +#line 795 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE | WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).type_var = (yyvsp[-2].var); (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2973 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2988 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 127: -#line 793 "src/wasm-parser.y" /* yacc.c:1646 */ + case 128: +#line 801 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE; (yyval.func).type_var = (yyvsp[-1].var); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 2983 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 2998 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 128: -#line 798 "src/wasm-parser.y" /* yacc.c:1646 */ + case 129: +#line 806 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE; (yyval.func).type_var = (yyvsp[-2].var); (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 2994 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3009 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 129: -#line 804 "src/wasm-parser.y" /* yacc.c:1646 */ + case 130: +#line 812 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_FUNC_TYPE; (yyval.func).type_var = (yyvsp[-1].var); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 3004 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3019 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 130: -#line 809 "src/wasm-parser.y" /* yacc.c:1646 */ + case 131: +#line 817 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).params = (yyvsp[0].type_bindings); } -#line 3013 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3028 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 131: -#line 813 "src/wasm-parser.y" /* yacc.c:1646 */ + case 132: +#line 821 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).result_type = (yyvsp[0].type); } -#line 3023 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3038 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 132: -#line 818 "src/wasm-parser.y" /* yacc.c:1646 */ + case 133: +#line 826 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).params = (yyvsp[-2].type_bindings); (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 3034 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3049 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 133: -#line 824 "src/wasm-parser.y" /* yacc.c:1646 */ + case 134: +#line 832 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).params = (yyvsp[-3].type_bindings); @@ -3042,138 +3057,138 @@ yyreduce: (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 3046 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3061 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 134: -#line 831 "src/wasm-parser.y" /* yacc.c:1646 */ + case 135: +#line 839 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).params = (yyvsp[-2].type_bindings); (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 3057 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3072 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 135: -#line 837 "src/wasm-parser.y" /* yacc.c:1646 */ + case 136: +#line 845 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 3067 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3082 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 136: -#line 842 "src/wasm-parser.y" /* yacc.c:1646 */ + case 137: +#line 850 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).params = (yyvsp[-2].type_bindings); (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 3078 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3093 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 137: -#line 848 "src/wasm-parser.y" /* yacc.c:1646 */ + case 138: +#line 856 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).params = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 3088 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3103 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 138: -#line 853 "src/wasm-parser.y" /* yacc.c:1646 */ + case 139: +#line 861 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).result_type = (yyvsp[0].type); } -#line 3097 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3112 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 139: -#line 857 "src/wasm-parser.y" /* yacc.c:1646 */ + case 140: +#line 865 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 3107 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3122 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 140: -#line 862 "src/wasm-parser.y" /* yacc.c:1646 */ + case 141: +#line 870 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).result_type = (yyvsp[-2].type); (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 3118 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3133 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 141: -#line 868 "src/wasm-parser.y" /* yacc.c:1646 */ + case 142: +#line 876 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).result_type = (yyvsp[-1].type); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 3128 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3143 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 142: -#line 873 "src/wasm-parser.y" /* yacc.c:1646 */ + case 143: +#line 881 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).locals = (yyvsp[0].type_bindings); } -#line 3137 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3152 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 143: -#line 877 "src/wasm-parser.y" /* yacc.c:1646 */ + case 144: +#line 885 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).locals = (yyvsp[-1].type_bindings); (yyval.func).exprs = (yyvsp[0].exprs); } -#line 3147 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3162 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 144: -#line 882 "src/wasm-parser.y" /* yacc.c:1646 */ + case 145: +#line 890 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func).flags = WASM_FUNC_FLAG_HAS_SIGNATURE; (yyval.func).exprs = (yyvsp[0].exprs); } -#line 3156 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3171 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 145: -#line 888 "src/wasm-parser.y" /* yacc.c:1646 */ + case 146: +#line 896 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.func)); } -#line 3162 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3177 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 146: -#line 888 "src/wasm-parser.y" /* yacc.c:1646 */ + case 147: +#line 896 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func) = (yyvsp[-1].func); (yyval.func).loc = (yylsp[-3]); extend_type_bindings(&(yyval.func).params_and_locals, &(yyval.func).params); extend_type_bindings(&(yyval.func).params_and_locals, &(yyval.func).locals); } -#line 3173 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3188 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 147: -#line 899 "src/wasm-parser.y" /* yacc.c:1646 */ + case 148: +#line 907 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.segment).loc = (yylsp[-3]); if (!read_int32((yyvsp[-2].text).start, (yyvsp[-2].text).start + (yyvsp[-2].text).length, &(yyval.segment).addr, 0)) @@ -3181,23 +3196,23 @@ yyreduce: (yyvsp[-2].text).length, (yyvsp[-2].text).start); dup_string_contents(&(yyvsp[-1].text), &(yyval.segment).data, &(yyval.segment).size); } -#line 3185 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3200 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 148: -#line 908 "src/wasm-parser.y" /* yacc.c:1646 */ + case 149: +#line 916 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.segments)); } -#line 3191 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3206 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 149: -#line 909 "src/wasm-parser.y" /* yacc.c:1646 */ + case 150: +#line 917 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.segments) = (yyvsp[-1].segments); *wasm_append_segment(&(yyval.segments)) = (yyvsp[0].segment); } -#line 3197 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3212 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 150: -#line 913 "src/wasm-parser.y" /* yacc.c:1646 */ + case 151: +#line 921 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.memory).loc = (yylsp[-4]); if (!read_int32((yyvsp[-3].text).start, (yyvsp[-3].text).start + (yyvsp[-3].text).length, &(yyval.memory).initial_size, 0)) @@ -3208,11 +3223,11 @@ yyreduce: (yyvsp[-2].text).length, (yyvsp[-2].text).start); (yyval.memory).segments = (yyvsp[-1].segments); } -#line 3212 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3227 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 151: -#line 923 "src/wasm-parser.y" /* yacc.c:1646 */ + case 152: +#line 931 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.memory).loc = (yylsp[-3]); if (!read_int32((yyvsp[-2].text).start, (yyvsp[-2].text).start + (yyvsp[-2].text).length, &(yyval.memory).initial_size, 0)) @@ -3221,103 +3236,103 @@ yyreduce: (yyval.memory).max_size = (yyval.memory).initial_size; (yyval.memory).segments = (yyvsp[-1].segments); } -#line 3225 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3240 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 152: -#line 934 "src/wasm-parser.y" /* yacc.c:1646 */ + case 153: +#line 942 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.func_type)); (yyval.func_type).sig = (yyvsp[-2].func_sig); } -#line 3234 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3249 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 153: -#line 938 "src/wasm-parser.y" /* yacc.c:1646 */ + case 154: +#line 946 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.func_type).name = (yyvsp[-5].text); (yyval.func_type).sig = (yyvsp[-2].func_sig); } -#line 3243 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3258 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 154: -#line 945 "src/wasm-parser.y" /* yacc.c:1646 */ + case 155: +#line 953 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.vars) = (yyvsp[-1].vars); } -#line 3249 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3264 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 155: -#line 949 "src/wasm-parser.y" /* yacc.c:1646 */ + case 156: +#line 957 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.import)); (yyval.import).import_type = WASM_IMPORT_HAS_TYPE; - DUPTEXT((yyval.import).module_name, (yyvsp[-3].text)); - DUPTEXT((yyval.import).func_name, (yyvsp[-2].text)); + DUPQUOTEDTEXT((yyval.import).module_name, (yyvsp[-3].text)); + DUPQUOTEDTEXT((yyval.import).func_name, (yyvsp[-2].text)); (yyval.import).type_var = (yyvsp[-1].var); } -#line 3261 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3276 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 156: -#line 956 "src/wasm-parser.y" /* yacc.c:1646 */ + case 157: +#line 964 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.import)); (yyval.import).import_type = WASM_IMPORT_HAS_TYPE; (yyval.import).name = (yyvsp[-4].text); - DUPTEXT((yyval.import).module_name, (yyvsp[-3].text)); - DUPTEXT((yyval.import).func_name, (yyvsp[-2].text)); + DUPQUOTEDTEXT((yyval.import).module_name, (yyvsp[-3].text)); + DUPQUOTEDTEXT((yyval.import).func_name, (yyvsp[-2].text)); (yyval.import).type_var = (yyvsp[-1].var); } -#line 3274 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3289 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 157: -#line 964 "src/wasm-parser.y" /* yacc.c:1646 */ + case 158: +#line 972 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.import)); (yyval.import).import_type = WASM_IMPORT_HAS_FUNC_SIGNATURE; - DUPTEXT((yyval.import).module_name, (yyvsp[-3].text)); - DUPTEXT((yyval.import).func_name, (yyvsp[-2].text)); + DUPQUOTEDTEXT((yyval.import).module_name, (yyvsp[-3].text)); + DUPQUOTEDTEXT((yyval.import).func_name, (yyvsp[-2].text)); (yyval.import).func_sig = (yyvsp[-1].func_sig); } -#line 3286 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3301 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 158: -#line 971 "src/wasm-parser.y" /* yacc.c:1646 */ + case 159: +#line 979 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.import)); (yyval.import).import_type = WASM_IMPORT_HAS_FUNC_SIGNATURE; (yyval.import).name = (yyvsp[-4].text); - DUPTEXT((yyval.import).module_name, (yyvsp[-3].text)); - DUPTEXT((yyval.import).func_name, (yyvsp[-2].text)); + DUPQUOTEDTEXT((yyval.import).module_name, (yyvsp[-3].text)); + DUPQUOTEDTEXT((yyval.import).func_name, (yyvsp[-2].text)); (yyval.import).func_sig = (yyvsp[-1].func_sig); } -#line 3299 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3314 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 159: -#line 982 "src/wasm-parser.y" /* yacc.c:1646 */ + case 160: +#line 990 "src/wasm-parser.y" /* yacc.c:1646 */ { DUPQUOTEDTEXT((yyval.export).name, (yyvsp[-2].text)); (yyval.export).var = (yyvsp[-1].var); } -#line 3308 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3323 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 160: -#line 989 "src/wasm-parser.y" /* yacc.c:1646 */ + case 161: +#line 997 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.type_bindings)); (yyval.type_bindings).types = (yyvsp[-1].types); } -#line 3317 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3332 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 161: -#line 993 "src/wasm-parser.y" /* yacc.c:1646 */ + case 162: +#line 1001 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.type_bindings)); WasmBinding* binding = wasm_append_binding(&(yyval.type_bindings).bindings); @@ -3326,17 +3341,17 @@ yyreduce: binding->index = 0; *wasm_append_type(&(yyval.type_bindings).types) = (yyvsp[-1].type); } -#line 3330 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3345 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 162: -#line 1004 "src/wasm-parser.y" /* yacc.c:1646 */ + case 163: +#line 1012 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.module_fields)); } -#line 3336 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3351 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 163: -#line 1005 "src/wasm-parser.y" /* yacc.c:1646 */ + case 164: +#line 1013 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.module_fields) = (yyvsp[-1].module_fields); WasmModuleField* field = wasm_append_module_field(&(yyval.module_fields)); @@ -3344,11 +3359,11 @@ yyreduce: field->type = WASM_MODULE_FIELD_TYPE_FUNC; field->func = (yyvsp[0].func); } -#line 3348 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3363 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 164: -#line 1012 "src/wasm-parser.y" /* yacc.c:1646 */ + case 165: +#line 1020 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.module_fields) = (yyvsp[-1].module_fields); WasmModuleField* field = wasm_append_module_field(&(yyval.module_fields)); @@ -3356,11 +3371,11 @@ yyreduce: field->type = WASM_MODULE_FIELD_TYPE_IMPORT; field->import = (yyvsp[0].import); } -#line 3360 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3375 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 165: -#line 1019 "src/wasm-parser.y" /* yacc.c:1646 */ + case 166: +#line 1027 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.module_fields) = (yyvsp[-1].module_fields); WasmModuleField* field = wasm_append_module_field(&(yyval.module_fields)); @@ -3368,11 +3383,11 @@ yyreduce: field->type = WASM_MODULE_FIELD_TYPE_EXPORT; field->export = (yyvsp[0].export); } -#line 3372 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3387 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 166: -#line 1026 "src/wasm-parser.y" /* yacc.c:1646 */ + case 167: +#line 1034 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.module_fields) = (yyvsp[-1].module_fields); WasmModuleField* field = wasm_append_module_field(&(yyval.module_fields)); @@ -3380,11 +3395,11 @@ yyreduce: field->type = WASM_MODULE_FIELD_TYPE_TABLE; field->table = (yyvsp[0].vars); } -#line 3384 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3399 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 167: -#line 1033 "src/wasm-parser.y" /* yacc.c:1646 */ + case 168: +#line 1041 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.module_fields) = (yyvsp[-1].module_fields); WasmModuleField* field = wasm_append_module_field(&(yyval.module_fields)); @@ -3392,11 +3407,11 @@ yyreduce: field->type = WASM_MODULE_FIELD_TYPE_FUNC_TYPE; field->func_type = (yyvsp[0].func_type); } -#line 3396 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3411 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 168: -#line 1040 "src/wasm-parser.y" /* yacc.c:1646 */ + case 169: +#line 1048 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.module_fields) = (yyvsp[-1].module_fields); WasmModuleField* field = wasm_append_module_field(&(yyval.module_fields)); @@ -3404,11 +3419,11 @@ yyreduce: field->type = WASM_MODULE_FIELD_TYPE_MEMORY; field->memory = (yyvsp[0].memory); } -#line 3408 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3423 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 169: -#line 1047 "src/wasm-parser.y" /* yacc.c:1646 */ + case 170: +#line 1055 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.module_fields) = (yyvsp[-1].module_fields); WasmModuleField* field = wasm_append_module_field(&(yyval.module_fields)); @@ -3416,11 +3431,11 @@ yyreduce: field->type = WASM_MODULE_FIELD_TYPE_GLOBAL; field->global = (yyvsp[0].type_bindings); } -#line 3420 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3435 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 170: -#line 1056 "src/wasm-parser.y" /* yacc.c:1646 */ + case 171: +#line 1064 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.module).loc = (yylsp[-2]); (yyval.module).fields = (yyvsp[-1].module_fields); @@ -3479,38 +3494,38 @@ yyreduce: } } } -#line 3483 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3498 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 171: -#line 1120 "src/wasm-parser.y" /* yacc.c:1646 */ + case 172: +#line 1128 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.command).type = WASM_COMMAND_TYPE_MODULE; (yyval.command).module = (yyvsp[0].module); } -#line 3489 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3504 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 172: -#line 1121 "src/wasm-parser.y" /* yacc.c:1646 */ + case 173: +#line 1129 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.command).type = WASM_COMMAND_TYPE_INVOKE; (yyval.command).invoke.loc = (yylsp[-3]); DUPQUOTEDTEXT((yyval.command).invoke.name, (yyvsp[-2].text)); (yyval.command).invoke.args = (yyvsp[-1].consts); } -#line 3500 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3515 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 173: -#line 1127 "src/wasm-parser.y" /* yacc.c:1646 */ + case 174: +#line 1135 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.command).type = WASM_COMMAND_TYPE_ASSERT_INVALID; (yyval.command).assert_invalid.module = (yyvsp[-2].module); (yyval.command).assert_invalid.text = (yyvsp[-1].text); } -#line 3510 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3525 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 174: -#line 1132 "src/wasm-parser.y" /* yacc.c:1646 */ + case 175: +#line 1140 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.command).type = WASM_COMMAND_TYPE_ASSERT_RETURN; (yyval.command).assert_return.invoke.loc = (yylsp[-5]); @@ -3518,22 +3533,22 @@ yyreduce: (yyval.command).assert_return.invoke.args = (yyvsp[-3].consts); (yyval.command).assert_return.expected = (yyvsp[-1].const_); } -#line 3522 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3537 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 175: -#line 1139 "src/wasm-parser.y" /* yacc.c:1646 */ + case 176: +#line 1147 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.command).type = WASM_COMMAND_TYPE_ASSERT_RETURN_NAN; (yyval.command).assert_return_nan.invoke.loc = (yylsp[-4]); DUPQUOTEDTEXT((yyval.command).assert_return_nan.invoke.name, (yyvsp[-3].text)); (yyval.command).assert_return_nan.invoke.args = (yyvsp[-2].consts); } -#line 3533 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3548 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 176: -#line 1145 "src/wasm-parser.y" /* yacc.c:1646 */ + case 177: +#line 1153 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.command).type = WASM_COMMAND_TYPE_ASSERT_TRAP; (yyval.command).assert_trap.invoke.loc = (yylsp[-5]); @@ -3541,23 +3556,23 @@ yyreduce: (yyval.command).assert_trap.invoke.args = (yyvsp[-3].consts); (yyval.command).assert_trap.text = (yyvsp[-1].text); } -#line 3545 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3560 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 177: -#line 1154 "src/wasm-parser.y" /* yacc.c:1646 */ + case 178: +#line 1162 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.commands)); } -#line 3551 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3566 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 178: -#line 1155 "src/wasm-parser.y" /* yacc.c:1646 */ + case 179: +#line 1163 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.commands) = (yyvsp[-1].commands); *wasm_append_command(&(yyval.commands)) = (yyvsp[0].command); } -#line 3557 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3572 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 179: -#line 1159 "src/wasm-parser.y" /* yacc.c:1646 */ + case 180: +#line 1167 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.const_).loc = (yylsp[-2]); if (!read_const((yyvsp[-2].type), (yyvsp[-1].text).start, (yyvsp[-1].text).start + (yyvsp[-1].text).length, &(yyval.const_))) @@ -3565,35 +3580,35 @@ yyreduce: (yyvsp[-1].text).length, (yyvsp[-1].text).start); free((char*)(yyvsp[-1].text).start); } -#line 3569 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3584 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 180: -#line 1168 "src/wasm-parser.y" /* yacc.c:1646 */ + case 181: +#line 1176 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.const_).type = WASM_TYPE_VOID; } -#line 3575 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3590 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 182: -#line 1172 "src/wasm-parser.y" /* yacc.c:1646 */ + case 183: +#line 1180 "src/wasm-parser.y" /* yacc.c:1646 */ { ZEROMEM((yyval.consts)); } -#line 3581 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3596 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 183: -#line 1173 "src/wasm-parser.y" /* yacc.c:1646 */ + case 184: +#line 1181 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.consts) = (yyvsp[-1].consts); *wasm_append_const(&(yyval.consts)) = (yyvsp[0].const_); } -#line 3587 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3602 "src/wasm-parser.c" /* yacc.c:1646 */ break; - case 184: -#line 1177 "src/wasm-parser.y" /* yacc.c:1646 */ + case 185: +#line 1185 "src/wasm-parser.y" /* yacc.c:1646 */ { (yyval.script).commands = (yyvsp[0].commands); parser->script = (yyval.script); } -#line 3593 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3608 "src/wasm-parser.c" /* yacc.c:1646 */ break; -#line 3597 "src/wasm-parser.c" /* yacc.c:1646 */ +#line 3612 "src/wasm-parser.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3828,7 +3843,7 @@ yyreturn: #endif return yyresult; } -#line 1180 "src/wasm-parser.y" /* yacc.c:1906 */ +#line 1188 "src/wasm-parser.y" /* yacc.c:1906 */ DEFINE_VECTOR(type, WasmType) diff --git a/src/wasm-parser.y b/src/wasm-parser.y index b1562b15..c8d53304 100644 --- a/src/wasm-parser.y +++ b/src/wasm-parser.y @@ -235,7 +235,13 @@ expr1 : $$->br_if.var = $2; $$->br_if.cond = $3; } - | LOOP labeling labeling expr_list { + | LOOP labeling expr_list { + $$ = wasm_new_expr(WASM_EXPR_TYPE_LOOP); + ZEROMEM($$->loop.outer); + $$->loop.inner = $2; + $$->loop.exprs = $3; + } + | LOOP bind_var bind_var expr_list { $$ = wasm_new_expr(WASM_EXPR_TYPE_LOOP); $$->loop.outer = $2; $$->loop.inner = $3; @@ -502,7 +508,9 @@ type_use : LPAR TYPE var RPAR { $$ = $3; } ; func_info : - /* empty */ {} + /* empty */ { + $$.flags = WASM_FUNC_FLAG_HAS_SIGNATURE; + } | bind_var { $$.flags = WASM_FUNC_FLAG_HAS_SIGNATURE; $$.name = $1; @@ -949,31 +957,31 @@ import : LPAR IMPORT TEXT TEXT type_use RPAR { ZEROMEM($$); $$.import_type = WASM_IMPORT_HAS_TYPE; - DUPTEXT($$.module_name, $3); - DUPTEXT($$.func_name, $4); + DUPQUOTEDTEXT($$.module_name, $3); + DUPQUOTEDTEXT($$.func_name, $4); $$.type_var = $5; } | LPAR IMPORT bind_var TEXT TEXT type_use RPAR /* Sugar */ { ZEROMEM($$); $$.import_type = WASM_IMPORT_HAS_TYPE; $$.name = $3; - DUPTEXT($$.module_name, $4); - DUPTEXT($$.func_name, $5); + DUPQUOTEDTEXT($$.module_name, $4); + DUPQUOTEDTEXT($$.func_name, $5); $$.type_var = $6; } | LPAR IMPORT TEXT TEXT func_type RPAR /* Sugar */ { ZEROMEM($$); $$.import_type = WASM_IMPORT_HAS_FUNC_SIGNATURE; - DUPTEXT($$.module_name, $3); - DUPTEXT($$.func_name, $4); + DUPQUOTEDTEXT($$.module_name, $3); + DUPQUOTEDTEXT($$.func_name, $4); $$.func_sig = $5; } | LPAR IMPORT bind_var TEXT TEXT func_type RPAR /* Sugar */ { ZEROMEM($$); $$.import_type = WASM_IMPORT_HAS_FUNC_SIGNATURE; $$.name = $3; - DUPTEXT($$.module_name, $4); - DUPTEXT($$.func_name, $5); + DUPQUOTEDTEXT($$.module_name, $4); + DUPQUOTEDTEXT($$.func_name, $5); $$.func_sig = $6; } ; @@ -199,6 +199,13 @@ typedef enum WasmConvertOpType { WASM_CONVERT_OP_TYPE_I64_TRUNC_U_F64, } WasmConvertOpType; +typedef enum WasmCastOpType { + WASM_CAST_OP_TYPE_F32_REINTERPRET_I32, + WASM_CAST_OP_TYPE_F64_REINTERPRET_I64, + WASM_CAST_OP_TYPE_I32_REINTERPRET_F32, + WASM_CAST_OP_TYPE_I64_REINTERPRET_F64, +} WasmCastOpType; + typedef struct WasmUnaryOp { WasmType type; WasmUnaryOpType op_type; @@ -222,6 +229,7 @@ typedef struct WasmConvertOp { typedef struct WasmCastOp { WasmType type; + WasmCastOpType op_type; WasmType type2; } WasmCastOp; @@ -550,9 +558,12 @@ void wasm_free_scanner(WasmScanner scanner); WasmResult wasm_check_script(WasmScript*); WasmResult wasm_write_binary(WasmBinaryWriter*, WasmScript*); +int wasm_get_index_from_var(WasmBindingVector* bindings, WasmVar* var); int wasm_get_func_index_by_var(WasmModule* module, WasmVar* var); int wasm_get_func_type_index_by_var(WasmModule* module, WasmVar* var); +int wasm_get_global_index_by_var(WasmModule* module, WasmVar* var); int wasm_get_import_index_by_var(WasmModule* module, WasmVar* var); +int wasm_get_local_index_by_var(WasmFunc* func, WasmVar* var); WasmFuncPtr wasm_get_func_by_var(WasmModule* module, WasmVar* var); WasmFuncTypePtr wasm_get_func_type_by_var(WasmModule* module, WasmVar* var); diff --git a/test/dump/basic.txt b/test/dump/basic.txt index 4fe8f5b2..60bd6d47 100644 --- a/test/dump/basic.txt +++ b/test/dump/basic.txt @@ -19,21 +19,21 @@ 000000c: 01 ; WASM_SECTION_SIGNATURES 000000d: 01 ; num signatures ; signature 0 -000000e: 02 ; num args +000000e: 02 ; num params 000000f: 01 ; result_type -0000010: 01 ; arg type -0000011: 01 ; arg type +0000010: 01 ; param type +0000011: 01 ; param type 0000012: 02 ; WASM_SECTION_FUNCTIONS 0000013: 01 ; num functions ; function 0 -0000014: 01 ; func flags +0000014: 09 ; func flags 0000015: 0000 ; func signature index 0000017: 0000 0000 ; func name offset 000001b: 0000 ; func body size -000001d: 11 ; OPCODE_SET_GLOBAL +000001d: 11 ; OPCODE_STORE_GLOBAL 000001e: 00 ; global index 000001f: 40 ; OPCODE_I32_ADD -0000020: 10 ; OPCODE_GET_GLOBAL +0000020: 10 ; OPCODE_LOAD_GLOBAL 0000021: 00 ; global index 0000022: 09 ; OPCODE_I8_CONST 0000023: 01 ; u8 literal @@ -44,11 +44,8 @@ 0000028: 01 ; remapped local index 000001b: 0c00 ; FIXUP func body size 0000029: 06 ; WASM_SECTION_END -; names +; export 0 0000017: 2a00 0000 ; FIXUP func name offset -0000014: 09 ; FIXUP func exported -000002a: 6600 ; export name -0000000: 0000 0001 0301 0000 0000 0400 0101 0201 ................ -0000010: 0101 0201 0900 002a 0000 000c 0011 0040 .......*.......@ -0000020: 1000 0901 400e 000e 0106 6600 ....@.....f. +000002a: 66 ; export name +000002b: 00 ; \0 ;;; STDOUT ;;) diff --git a/test/dump/binary.txt b/test/dump/binary.txt index fe06ca09..df03c756 100644 --- a/test/dump/binary.txt +++ b/test/dump/binary.txt @@ -99,7 +99,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -111,16 +111,16 @@ 0000013: 40 ; OPCODE_I32_ADD 0000014: 41 ; OPCODE_I32_SUB 0000015: 42 ; OPCODE_I32_MUL -0000016: 43 ; OPCODE_I32_SDIV -0000017: 44 ; OPCODE_I32_UDIV -0000018: 45 ; OPCODE_I32_SREM -0000019: 46 ; OPCODE_I32_UREM +0000016: 43 ; OPCODE_I32_DIV_S +0000017: 44 ; OPCODE_I32_DIV_U +0000018: 45 ; OPCODE_I32_REM_S +0000019: 46 ; OPCODE_I32_REM_U 000001a: 47 ; OPCODE_I32_AND 000001b: 48 ; OPCODE_I32_OR 000001c: 49 ; OPCODE_I32_XOR 000001d: 4a ; OPCODE_I32_SHL -000001e: 4b ; OPCODE_I32_SHR -000001f: 4c ; OPCODE_I32_SAR +000001e: 4b ; OPCODE_I32_SHR_U +000001f: 4c ; OPCODE_I32_SHR_S 0000020: 09 ; OPCODE_I8_CONST 0000021: 00 ; u8 literal 0000022: 09 ; OPCODE_I8_CONST @@ -152,16 +152,16 @@ 000003c: 5b ; OPCODE_I64_ADD 000003d: 5c ; OPCODE_I64_SUB 000003e: 5d ; OPCODE_I64_MUL -000003f: 5e ; OPCODE_I64_SDIV -0000040: 5f ; OPCODE_I64_UDIV -0000041: 60 ; OPCODE_I64_SREM -0000042: 61 ; OPCODE_I64_UREM +000003f: 5e ; OPCODE_I64_DIV_S +0000040: 5f ; OPCODE_I64_DIV_U +0000041: 60 ; OPCODE_I64_REM_S +0000042: 61 ; OPCODE_I64_REM_U 0000043: 62 ; OPCODE_I64_AND 0000044: 63 ; OPCODE_I64_OR 0000045: 64 ; OPCODE_I64_XOR 0000046: 65 ; OPCODE_I64_SHL -0000047: 66 ; OPCODE_I64_SHR -0000048: 67 ; OPCODE_I64_SAR +0000047: 66 ; OPCODE_I64_SHR_U +0000048: 67 ; OPCODE_I64_SHR_S 0000049: 0b ; OPCODE_I64_CONST 000004a: 0000 0000 0000 0000 ; u64 literal 0000052: 0b ; OPCODE_I64_CONST @@ -238,26 +238,4 @@ 000013d: 0000 0000 0000 0000 ; f64 literal 0000011: 3201 ; FIXUP func body size 0000145: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0032 0140 4142 4344 4546 4748 494a 4b4c .2.@ABCDEFGHIJKL -0000020: 0900 0900 0900 0900 0900 0900 0900 0900 ................ -0000030: 0900 0900 0900 0900 0900 0900 5b5c 5d5e ............[\]^ -0000040: 5f60 6162 6364 6566 670b 0000 0000 0000 _`abcdefg....... -0000050: 0000 0b00 0000 0000 0000 000b 0000 0000 ................ -0000060: 0000 0000 0b00 0000 0000 0000 000b 0000 ................ -0000070: 0000 0000 0000 0b00 0000 0000 0000 000b ................ -0000080: 0000 0000 0000 0000 0b00 0000 0000 0000 ................ -0000090: 000b 0000 0000 0000 0000 0b00 0000 0000 ................ -00000a0: 0000 000b 0000 0000 0000 0000 0b00 0000 ................ -00000b0: 0000 0000 000b 0000 0000 0000 0000 0b00 ................ -00000c0: 0000 0000 0000 0075 7677 7879 7a7d 0d00 .......uvwxyz}.. -00000d0: 0000 000d 0000 0000 0d00 0000 000d 0000 ................ -00000e0: 0000 0d00 0000 000d 0000 0000 0d00 0000 ................ -00000f0: 000d 0000 0000 898a 8b8c 8d8e 910c 0000 ................ -0000100: 0000 0000 0000 0c00 0000 0000 0000 000c ................ -0000110: 0000 0000 0000 0000 0c00 0000 0000 0000 ................ -0000120: 000c 0000 0000 0000 0000 0c00 0000 0000 ................ -0000130: 0000 000c 0000 0000 0000 0000 0c00 0000 ................ -0000140: 0000 0000 0006 ...... ;;; STDOUT ;;) diff --git a/test/dump/block.txt b/test/dump/block.txt index 3b088adf..5b14c97b 100644 --- a/test/dump/block.txt +++ b/test/dump/block.txt @@ -17,10 +17,10 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 02 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type ; signature 1 -0000008: 00 ; num args +0000008: 00 ; num params 0000009: 01 ; result_type 000000a: 02 ; WASM_SECTION_FUNCTIONS 000000b: 02 ; num functions @@ -30,11 +30,10 @@ 000000f: 0000 0000 ; func name offset 0000013: 0000 ; func body size 0000015: 01 ; OPCODE_BLOCK -0000016: 00 ; num expressions +0000016: 03 ; num expressions 0000017: 00 ; OPCODE_NOP 0000018: 00 ; OPCODE_NOP 0000019: 00 ; OPCODE_NOP -0000016: 03 ; FIXUP num expressions 0000013: 0500 ; FIXUP func body size ; function 1 000001a: 01 ; func flags @@ -42,15 +41,9 @@ 000001d: 0000 0000 ; func name offset 0000021: 0000 ; func body size 0000023: 01 ; OPCODE_BLOCK -0000024: 00 ; num expressions +0000024: 01 ; num expressions 0000025: 09 ; OPCODE_I8_CONST 0000026: 01 ; u8 literal -0000023: 01 ; FIXUP OPCODE_BLOCK -0000024: 01 ; FIXUP num expressions 0000021: 0400 ; FIXUP func body size 0000027: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0102 0000 0001 0202 0100 0000 ................ -0000010: 0000 0005 0001 0300 0000 0101 0000 0000 ................ -0000020: 0004 0001 0109 0106 ........ ;;; STDOUT ;;) diff --git a/test/dump/break-block-named.txt b/test/dump/break-block-named.txt index 868619b1..44c20388 100644 --- a/test/dump/break-block-named.txt +++ b/test/dump/break-block-named.txt @@ -16,7 +16,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -26,29 +26,21 @@ 000000d: 0000 0000 ; func name offset 0000011: 0000 ; func body size 0000013: 01 ; OPCODE_BLOCK -0000014: 00 ; num expressions +0000014: 01 ; num expressions 0000015: 02 ; OPCODE_LOOP -0000016: 00 ; num expressions +0000016: 01 ; num expressions 0000017: 01 ; OPCODE_BLOCK -0000018: 00 ; num expressions +0000018: 02 ; num expressions 0000019: 09 ; OPCODE_I8_CONST 000001a: 00 ; u8 literal 000001b: 01 ; OPCODE_BLOCK -000001c: 00 ; num expressions +000001c: 02 ; num expressions 000001d: 06 ; OPCODE_BR 000001e: 00 ; break depth 000001f: 00 ; OPCODE_NOP 0000020: 06 ; OPCODE_BR 0000021: 04 ; break depth 0000022: 00 ; OPCODE_NOP -000001c: 02 ; FIXUP num expressions -0000018: 02 ; FIXUP num expressions -0000016: 01 ; FIXUP num expressions -0000014: 01 ; FIXUP num expressions 0000011: 1000 ; FIXUP func body size 0000023: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0010 0001 0102 0101 0209 0001 0206 0000 ................ -0000020: 0604 0006 .... ;;; STDOUT ;;) diff --git a/test/dump/break-block.txt b/test/dump/break-block.txt index b9409d05..72290eb2 100644 --- a/test/dump/break-block.txt +++ b/test/dump/break-block.txt @@ -18,7 +18,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -28,15 +28,15 @@ 000000d: 0000 0000 ; func name offset 0000011: 0000 ; func body size 0000013: 01 ; OPCODE_BLOCK -0000014: 00 ; num expressions +0000014: 01 ; num expressions 0000015: 02 ; OPCODE_LOOP -0000016: 00 ; num expressions +0000016: 01 ; num expressions 0000017: 01 ; OPCODE_BLOCK -0000018: 00 ; num expressions +0000018: 02 ; num expressions 0000019: 09 ; OPCODE_I8_CONST 000001a: 00 ; u8 literal 000001b: 01 ; OPCODE_BLOCK -000001c: 00 ; num expressions +000001c: 04 ; num expressions 000001d: 06 ; OPCODE_BR 000001e: 00 ; break depth 000001f: 00 ; OPCODE_NOP @@ -49,14 +49,6 @@ 0000026: 06 ; OPCODE_BR 0000027: 04 ; break depth 0000028: 00 ; OPCODE_NOP -000001c: 04 ; FIXUP num expressions -0000018: 02 ; FIXUP num expressions -0000016: 01 ; FIXUP num expressions -0000014: 01 ; FIXUP num expressions 0000011: 1600 ; FIXUP func body size 0000029: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0016 0001 0102 0101 0209 0001 0406 0000 ................ -0000020: 0600 0006 0200 0604 0006 .......... ;;; STDOUT ;;) diff --git a/test/dump/break-label.txt b/test/dump/break-label.txt index 698c0a44..32d67375 100644 --- a/test/dump/break-label.txt +++ b/test/dump/break-label.txt @@ -14,7 +14,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -26,7 +26,7 @@ 0000013: 01 ; OPCODE_BLOCK 0000014: 01 ; num expressions 0000015: 01 ; OPCODE_BLOCK -0000016: 00 ; num expressions +0000016: 02 ; num expressions 0000017: 00 ; OPCODE_NOP 0000018: 03 ; OPCODE_IF 0000019: 09 ; OPCODE_I8_CONST @@ -34,10 +34,6 @@ 000001b: 06 ; OPCODE_BR 000001c: 01 ; break depth 000001d: 00 ; OPCODE_NOP -0000016: 02 ; FIXUP num expressions 0000011: 0b00 ; FIXUP func body size 000001e: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 000b 0001 0101 0200 0309 0106 0100 06 ............... ;;; STDOUT ;;) diff --git a/test/dump/break-loop-inner-expr.txt b/test/dump/break-loop-inner-expr.txt index 67611b8c..115b9ffd 100644 --- a/test/dump/break-loop-inner-expr.txt +++ b/test/dump/break-loop-inner-expr.txt @@ -15,7 +15,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -25,7 +25,7 @@ 000000d: 0000 0000 ; func name offset 0000011: 0000 ; func body size 0000013: 02 ; OPCODE_LOOP -0000014: 00 ; num expressions +0000014: 03 ; num expressions 0000015: 03 ; OPCODE_IF 0000016: 09 ; OPCODE_I8_CONST 0000017: 01 ; u8 literal @@ -42,11 +42,6 @@ 0000022: 04 ; u8 literal 0000023: 09 ; OPCODE_I8_CONST 0000024: 05 ; u8 literal -0000014: 03 ; FIXUP num expressions 0000011: 1200 ; FIXUP func body size 0000025: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0012 0002 0303 0901 0600 0902 0309 0306 ................ -0000020: 0109 0409 0506 ...... ;;; STDOUT ;;) diff --git a/test/dump/break-loop-inner.txt b/test/dump/break-loop-inner.txt index 7a84afce..adfcb69f 100644 --- a/test/dump/break-loop-inner.txt +++ b/test/dump/break-loop-inner.txt @@ -14,7 +14,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -24,7 +24,7 @@ 000000d: 0000 0000 ; func name offset 0000011: 0000 ; func body size 0000013: 02 ; OPCODE_LOOP -0000014: 00 ; num expressions +0000014: 02 ; num expressions 0000015: 03 ; OPCODE_IF 0000016: 09 ; OPCODE_I8_CONST 0000017: 01 ; u8 literal @@ -37,11 +37,6 @@ 000001e: 06 ; OPCODE_BR 000001f: 00 ; break depth 0000020: 00 ; OPCODE_NOP -0000014: 02 ; FIXUP num expressions 0000011: 0e00 ; FIXUP func body size 0000021: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 000e 0002 0203 0901 0601 0003 0902 0600 ................ -0000020: 0006 .. ;;; STDOUT ;;) diff --git a/test/dump/break-loop.txt b/test/dump/break-loop.txt index f1b8c842..0b77f464 100644 --- a/test/dump/break-loop.txt +++ b/test/dump/break-loop.txt @@ -12,7 +12,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -22,17 +22,13 @@ 000000d: 0000 0000 ; func name offset 0000011: 0000 ; func body size 0000013: 02 ; OPCODE_LOOP -0000014: 00 ; num expressions +0000014: 01 ; num expressions 0000015: 03 ; OPCODE_IF 0000016: 09 ; OPCODE_I8_CONST 0000017: 01 ; u8 literal 0000018: 06 ; OPCODE_BR 0000019: 00 ; break depth 000001a: 00 ; OPCODE_NOP -0000014: 01 ; FIXUP num expressions 0000011: 0800 ; FIXUP func body size 000001b: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0008 0002 0103 0901 0600 0006 ............ ;;; STDOUT ;;) diff --git a/test/dump/brif-loop.txt b/test/dump/brif-loop.txt index 715388ba..1f6447b0 100644 --- a/test/dump/brif-loop.txt +++ b/test/dump/brif-loop.txt @@ -2,7 +2,7 @@ (module (func (loop $cont - (br_if (i32.const 0) $cont)))) + (br_if $cont (i32.const 0))))) (;; STDOUT ;;; 0000000: 00 ; WASM_SECTION_MEMORY 0000001: 00 ; min mem size log 2 @@ -11,7 +11,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -21,17 +21,12 @@ 000000d: 0000 0000 ; func name offset 0000011: 0000 ; func body size 0000013: 02 ; OPCODE_LOOP -0000014: 00 ; num expressions +0000014: 01 ; num expressions 0000015: 07 ; OPCODE_BR_IF 0000016: 00 ; break depth 0000017: 09 ; OPCODE_I8_CONST 0000018: 00 ; u8 literal -0000016: 00 ; FIXUP break depth 0000019: 00 ; OPCODE_NOP -0000014: 01 ; FIXUP num expressions 0000011: 0700 ; FIXUP func body size 000001a: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0007 0002 0107 0009 0000 06 ........... ;;; STDOUT ;;) diff --git a/test/dump/brif.txt b/test/dump/brif.txt index c327a1b9..cb5bcf01 100644 --- a/test/dump/brif.txt +++ b/test/dump/brif.txt @@ -2,7 +2,7 @@ (module (func (block $foo - (br_if (i32.const 1) $foo)))) + (br_if $foo (i32.const 1))))) (;; STDOUT ;;; 0000000: 00 ; WASM_SECTION_MEMORY 0000001: 00 ; min mem size log 2 @@ -11,7 +11,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -21,17 +21,12 @@ 000000d: 0000 0000 ; func name offset 0000011: 0000 ; func body size 0000013: 01 ; OPCODE_BLOCK -0000014: 00 ; num expressions +0000014: 01 ; num expressions 0000015: 07 ; OPCODE_BR_IF 0000016: 00 ; break depth 0000017: 09 ; OPCODE_I8_CONST 0000018: 01 ; u8 literal -0000016: 00 ; FIXUP break depth 0000019: 00 ; OPCODE_NOP -0000014: 01 ; FIXUP num expressions 0000011: 0700 ; FIXUP func body size 000001a: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0007 0001 0107 0009 0100 06 ........... ;;; STDOUT ;;) diff --git a/test/dump/call.txt b/test/dump/call.txt index 35594788..8762582f 100644 --- a/test/dump/call.txt +++ b/test/dump/call.txt @@ -10,9 +10,9 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 01 ; num args +0000006: 01 ; num params 0000007: 00 ; result_type -0000008: 01 ; arg type +0000008: 01 ; param type 0000009: 02 ; WASM_SECTION_FUNCTIONS 000000a: 01 ; num functions ; function 0 @@ -20,13 +20,10 @@ 000000c: 0000 ; func signature index 000000e: 0000 0000 ; func name offset 0000012: 0000 ; func body size -0000014: 12 ; OPCODE_CALL +0000014: 12 ; OPCODE_CALL_FUNCTION 0000015: 00 ; func index 0000016: 09 ; OPCODE_I8_CONST 0000017: 01 ; u8 literal 0000012: 0400 ; FIXUP func body size 0000018: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0100 0102 0101 0000 0000 ................ -0000010: 0000 0400 1200 0901 06 ......... ;;; STDOUT ;;) diff --git a/test/dump/callimport.txt b/test/dump/callimport.txt index c0c1d49b..ac83fb5d 100644 --- a/test/dump/callimport.txt +++ b/test/dump/callimport.txt @@ -17,12 +17,12 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 02 ; num signatures ; signature 0 -0000006: 02 ; num args +0000006: 02 ; num params 0000007: 01 ; result_type -0000008: 01 ; arg type -0000009: 03 ; arg type +0000008: 01 ; param type +0000009: 03 ; param type ; signature 1 -000000a: 00 ; num args +000000a: 00 ; num params 000000b: 01 ; result_type 000000c: 02 ; WASM_SECTION_FUNCTIONS 000000d: 02 ; num functions @@ -35,20 +35,18 @@ 0000016: 0100 ; func signature index 0000018: 0000 0000 ; func name offset 000001c: 0000 ; func body size -000001e: 12 ; OPCODE_CALL +000001e: 12 ; OPCODE_CALL_FUNCTION 000001f: 00 ; import index 0000020: 09 ; OPCODE_I8_CONST 0000021: 01 ; u8 literal 0000022: 0d ; OPCODE_F32_CONST 0000023: 0000 0040 ; f32 literal -0000027: 12 ; OPCODE_CALL +0000027: 12 ; OPCODE_CALL_FUNCTION 0000028: 01 ; func index 000001c: 0b00 ; FIXUP func body size 0000029: 06 ; WASM_SECTION_END -; names +; import 0 0000011: 2a00 0000 ; FIXUP import name offset -000002a: 6261 7200 ; import name -0000000: 0000 0001 0102 0201 0103 0001 0202 0300 ................ -0000010: 002a 0000 0001 0100 0000 0000 0b00 1200 .*.............. -0000020: 0901 0d00 0000 4012 0106 6261 7200 ......@...bar. +000002a: 6261 72 ; import name +000002d: 00 ; \0 ;;; STDOUT ;;) diff --git a/test/dump/callindirect.txt b/test/dump/callindirect.txt index 36fa3c0a..1c5a0252 100644 --- a/test/dump/callindirect.txt +++ b/test/dump/callindirect.txt @@ -12,9 +12,9 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 01 ; num args +0000006: 01 ; num params 0000007: 00 ; result_type -0000008: 01 ; arg type +0000008: 01 ; param type 0000009: 02 ; WASM_SECTION_FUNCTIONS 000000a: 01 ; num functions ; function 0 @@ -33,7 +33,4 @@ 000001b: 01 ; num function table entries 000001c: 0000 ; function table entry 000001e: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0100 0102 0101 0000 0000 ................ -0000010: 0000 0600 1300 0900 0900 0501 0000 06 ............... ;;; STDOUT ;;) diff --git a/test/dump/cast.txt b/test/dump/cast.txt index e7fc1af9..90396536 100644 --- a/test/dump/cast.txt +++ b/test/dump/cast.txt @@ -14,7 +14,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -37,9 +37,4 @@ 0000028: 0000 0000 0000 0000 ; f64 literal 0000011: 1d00 ; FIXUP func body size 0000030: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 001d 00ad 0900 b40d 0000 0000 b30b 0000 ................ -0000020: 0000 0000 0000 b50c 0000 0000 0000 0000 ................ -0000030: 06 . ;;; STDOUT ;;) diff --git a/test/dump/compare.txt b/test/dump/compare.txt index 9c724f84..dba4f66a 100644 --- a/test/dump/compare.txt +++ b/test/dump/compare.txt @@ -57,7 +57,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -68,14 +68,14 @@ 0000011: 0000 ; func body size 0000013: 4d ; OPCODE_I32_EQ 0000014: 4e ; OPCODE_I32_NE -0000015: 4f ; OPCODE_I32_SLT -0000016: 51 ; OPCODE_I32_ULT -0000017: 50 ; OPCODE_I32_SLE -0000018: 52 ; OPCODE_I32_ULE -0000019: 53 ; OPCODE_I32_SGT -000001a: 55 ; OPCODE_I32_UGT -000001b: 54 ; OPCODE_I32_SGE -000001c: 56 ; OPCODE_I32_UGE +0000015: 4f ; OPCODE_I32_LT_S +0000016: 51 ; OPCODE_I32_LT_U +0000017: 50 ; OPCODE_I32_LE_S +0000018: 52 ; OPCODE_I32_LE_U +0000019: 53 ; OPCODE_I32_GT_S +000001a: 55 ; OPCODE_I32_GT_U +000001b: 54 ; OPCODE_I32_GE_S +000001c: 56 ; OPCODE_I32_GE_U 000001d: 09 ; OPCODE_I8_CONST 000001e: 00 ; u8 literal 000001f: 09 ; OPCODE_I8_CONST @@ -108,42 +108,42 @@ 0000048: 0000 0000 0000 0000 ; u64 literal 0000050: 0b ; OPCODE_I64_CONST 0000051: 0000 0000 0000 0000 ; u64 literal -0000059: 6a ; OPCODE_I64_SLT +0000059: 6a ; OPCODE_I64_LT_S 000005a: 0b ; OPCODE_I64_CONST 000005b: 0000 0000 0000 0000 ; u64 literal 0000063: 0b ; OPCODE_I64_CONST 0000064: 0000 0000 0000 0000 ; u64 literal -000006c: 6c ; OPCODE_I64_ULT +000006c: 6c ; OPCODE_I64_LT_U 000006d: 0b ; OPCODE_I64_CONST 000006e: 0000 0000 0000 0000 ; u64 literal 0000076: 0b ; OPCODE_I64_CONST 0000077: 0000 0000 0000 0000 ; u64 literal -000007f: 6b ; OPCODE_I64_SLE +000007f: 6b ; OPCODE_I64_LE_S 0000080: 0b ; OPCODE_I64_CONST 0000081: 0000 0000 0000 0000 ; u64 literal 0000089: 0b ; OPCODE_I64_CONST 000008a: 0000 0000 0000 0000 ; u64 literal -0000092: 6d ; OPCODE_I64_ULE +0000092: 6d ; OPCODE_I64_LE_U 0000093: 0b ; OPCODE_I64_CONST 0000094: 0000 0000 0000 0000 ; u64 literal 000009c: 0b ; OPCODE_I64_CONST 000009d: 0000 0000 0000 0000 ; u64 literal -00000a5: 6e ; OPCODE_I64_SGT +00000a5: 6e ; OPCODE_I64_GT_S 00000a6: 0b ; OPCODE_I64_CONST 00000a7: 0000 0000 0000 0000 ; u64 literal 00000af: 0b ; OPCODE_I64_CONST 00000b0: 0000 0000 0000 0000 ; u64 literal -00000b8: 70 ; OPCODE_I64_UGT +00000b8: 70 ; OPCODE_I64_GT_U 00000b9: 0b ; OPCODE_I64_CONST 00000ba: 0000 0000 0000 0000 ; u64 literal 00000c2: 0b ; OPCODE_I64_CONST 00000c3: 0000 0000 0000 0000 ; u64 literal -00000cb: 6f ; OPCODE_I64_SGE +00000cb: 6f ; OPCODE_I64_GE_S 00000cc: 0b ; OPCODE_I64_CONST 00000cd: 0000 0000 0000 0000 ; u64 literal 00000d5: 0b ; OPCODE_I64_CONST 00000d6: 0000 0000 0000 0000 ; u64 literal -00000de: 71 ; OPCODE_I64_UGE +00000de: 71 ; OPCODE_I64_GE_U 00000df: 0b ; OPCODE_I64_CONST 00000e0: 0000 0000 0000 0000 ; u64 literal 00000e8: 0b ; OPCODE_I64_CONST @@ -210,32 +210,4 @@ 000019d: 0000 0000 0000 0000 ; f64 literal 0000011: 9201 ; FIXUP func body size 00001a5: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0092 014d 4e4f 5150 5253 5554 5609 0009 ...MNOQPRSUTV... -0000020: 0009 0009 0009 0009 0009 0009 0009 0009 ................ -0000030: 0009 0068 0b00 0000 0000 0000 000b 0000 ...h............ -0000040: 0000 0000 0000 690b 0000 0000 0000 0000 ......i......... -0000050: 0b00 0000 0000 0000 006a 0b00 0000 0000 .........j...... -0000060: 0000 000b 0000 0000 0000 0000 6c0b 0000 ............l... -0000070: 0000 0000 0000 0b00 0000 0000 0000 006b ...............k -0000080: 0b00 0000 0000 0000 000b 0000 0000 0000 ................ -0000090: 0000 6d0b 0000 0000 0000 0000 0b00 0000 ..m............. -00000a0: 0000 0000 006e 0b00 0000 0000 0000 000b .....n.......... -00000b0: 0000 0000 0000 0000 700b 0000 0000 0000 ........p....... -00000c0: 0000 0b00 0000 0000 0000 006f 0b00 0000 ...........o.... -00000d0: 0000 0000 000b 0000 0000 0000 0000 710b ..............q. -00000e0: 0000 0000 0000 0000 0b00 0000 0000 0000 ................ -00000f0: 0083 0d00 0000 000d 0000 0000 840d 0000 ................ -0000100: 0000 0d00 0000 0085 0d00 0000 000d 0000 ................ -0000110: 0000 860d 0000 0000 0d00 0000 0087 0d00 ................ -0000120: 0000 000d 0000 0000 880d 0000 0000 0d00 ................ -0000130: 0000 0097 0c00 0000 0000 0000 000c 0000 ................ -0000140: 0000 0000 0000 980c 0000 0000 0000 0000 ................ -0000150: 0c00 0000 0000 0000 0099 0c00 0000 0000 ................ -0000160: 0000 000c 0000 0000 0000 0000 9a0c 0000 ................ -0000170: 0000 0000 0000 0c00 0000 0000 0000 009b ................ -0000180: 0c00 0000 0000 0000 000c 0000 0000 0000 ................ -0000190: 0000 9c0c 0000 0000 0000 0000 0c00 0000 ................ -00001a0: 0000 0000 0006 ...... ;;; STDOUT ;;) diff --git a/test/dump/const.txt b/test/dump/const.txt index dbf8edf1..ebbdd2cf 100644 --- a/test/dump/const.txt +++ b/test/dump/const.txt @@ -50,7 +50,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -137,23 +137,4 @@ 000010c: 182d 4454 fb21 1940 ; f64 literal 0000011: 0101 ; FIXUP func body size 0000114: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0001 0109 000a 0000 0080 09ff 0a00 0000 ................ -0000020: 8009 ff0b 0000 0000 0000 0000 0b00 0000 ................ -0000030: 0000 0000 800b ffff ffff ffff ffff 0b00 ................ -0000040: 0000 0000 0000 800b ffff ffff ffff ffff ................ -0000050: 0d00 0000 000d 1668 a965 0d40 204f 370d .......h.e.@ O7. -0000060: 0000 c07f 0d00 00c0 ff0d 0000 c07f 0dbc ................ -0000070: 0a80 7f0d bc0a 80ff 0dbc 0a80 7f0d 0000 ................ -0000080: 807f 0d00 0080 ff0d 0000 807f 0d00 0000 ................ -0000090: bf0d db0f c940 0c00 0000 0000 0000 000c .....@.......... -00000a0: b856 0e3c dd9a efbf 0c18 2d44 54fb 2119 .V.<......-DT.!. -00000b0: 400c 0000 0000 0000 f87f 0c00 0000 0000 @............... -00000c0: 00f8 ff0c 0000 0000 0000 f87f 0cbc 0a00 ................ -00000d0: 0000 00f0 7f0c bc0a 0000 0000 f0ff 0cbc ................ -00000e0: 0a00 0000 00f0 7f0c 0000 0000 0000 f07f ................ -00000f0: 0c00 0000 0000 00f0 ff0c 0000 0000 0000 ................ -0000100: f07f 0c00 0000 0000 00e0 bf0c 182d 4454 .............-DT -0000110: fb21 1940 06 .!.@. ;;; STDOUT ;;) diff --git a/test/dump/convert.txt b/test/dump/convert.txt index 2c9b9873..3290eef1 100644 --- a/test/dump/convert.txt +++ b/test/dump/convert.txt @@ -32,7 +32,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -70,9 +70,4 @@ 000002d: 0000 0000 ; f32 literal 0000011: 1e00 ; FIXUP func body size 0000031: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 001e 00a1 a79d a89f a99e aea0 af09 00a2 ................ -0000020: aaa4 aba3 b0a5 b1a6 0900 acb2 0d00 0000 ................ -0000030: 0006 .. ;;; STDOUT ;;) diff --git a/test/dump/dedupe-sig.txt b/test/dump/dedupe-sig.txt index e421d7f2..d76209a8 100644 --- a/test/dump/dedupe-sig.txt +++ b/test/dump/dedupe-sig.txt @@ -11,9 +11,9 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 01 ; num args +0000006: 01 ; num params 0000007: 02 ; result_type -0000008: 01 ; arg type +0000008: 01 ; param type 0000009: 02 ; WASM_SECTION_FUNCTIONS 000000a: 02 ; num functions ; import header 0 @@ -29,10 +29,8 @@ 000001c: 0000 0000 0000 0000 ; u64 literal 0000019: 0900 ; FIXUP func body size 0000024: 06 ; WASM_SECTION_END -; names +; import 0 000000e: 2500 0000 ; FIXUP import name offset -0000025: 6261 7200 ; import name -0000000: 0000 0001 0101 0102 0102 0203 0000 2500 ..............%. -0000010: 0000 0100 0000 0000 0009 000b 0000 0000 ................ -0000020: 0000 0000 0662 6172 00 .....bar. +0000025: 6261 72 ; import name +0000028: 00 ; \0 ;;; STDOUT ;;) diff --git a/test/dump/expr-break.txt b/test/dump/expr-break.txt index ffd06ef0..7fd70799 100644 --- a/test/dump/expr-break.txt +++ b/test/dump/expr-break.txt @@ -11,7 +11,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -28,7 +28,4 @@ 0000018: 01 ; u8 literal 0000011: 0600 ; FIXUP func body size 0000019: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0006 0001 0106 0009 0106 .......... ;;; STDOUT ;;) diff --git a/test/dump/func-exported.txt b/test/dump/func-exported.txt index 3eaf1493..eb0676c0 100644 --- a/test/dump/func-exported.txt +++ b/test/dump/func-exported.txt @@ -10,21 +10,19 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions ; function 0 -000000a: 01 ; func flags +000000a: 09 ; func flags 000000b: 0000 ; func signature index 000000d: 0000 0000 ; func name offset 0000011: 0000 ; func body size 0000011: 0000 ; FIXUP func body size 0000013: 06 ; WASM_SECTION_END -; names +; export 0 000000d: 1400 0000 ; FIXUP func name offset -000000a: 09 ; FIXUP func exported -0000014: 666f 6f00 ; export name -0000000: 0000 0001 0101 0000 0201 0900 0014 0000 ................ -0000010: 0000 0006 666f 6f00 ....foo. +0000014: 666f 6f ; export name +0000017: 00 ; \0 ;;; STDOUT ;;) diff --git a/test/dump/func-multi.txt b/test/dump/func-multi.txt index e866f99f..8ac1be89 100644 --- a/test/dump/func-multi.txt +++ b/test/dump/func-multi.txt @@ -11,7 +11,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 03 ; num functions @@ -34,8 +34,4 @@ 0000023: 0000 ; func body size 0000023: 0000 ; FIXUP func body size 0000025: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0203 0100 0000 0000 ................ -0000010: 0000 0001 0000 0000 0000 0000 0100 0000 ................ -0000020: 0000 0000 0006 ...... ;;; STDOUT ;;) diff --git a/test/dump/func-named.txt b/test/dump/func-named.txt index 69a61fab..f38a80bf 100644 --- a/test/dump/func-named.txt +++ b/test/dump/func-named.txt @@ -9,7 +9,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -20,7 +20,4 @@ 0000011: 0000 ; func body size 0000011: 0000 ; FIXUP func body size 0000013: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0000 0006 .... ;;; STDOUT ;;) diff --git a/test/dump/getlocal-param.txt b/test/dump/getlocal-param.txt index 35900839..18734afd 100644 --- a/test/dump/getlocal-param.txt +++ b/test/dump/getlocal-param.txt @@ -20,10 +20,10 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 02 ; num args +0000006: 02 ; num params 0000007: 00 ; result_type -0000008: 01 ; arg type -0000009: 03 ; arg type +0000008: 01 ; param type +0000009: 03 ; param type 000000a: 02 ; WASM_SECTION_FUNCTIONS 000000b: 01 ; num functions ; function 0 @@ -49,8 +49,4 @@ 0000028: 05 ; remapped local index 000001b: 0c00 ; FIXUP func body size 0000029: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0200 0103 0201 0500 0000 ................ -0000010: 0000 0001 0001 0002 0000 000c 000e 000e ................ -0000020: 010e 030e 040e 020e 0506 .......... ;;; STDOUT ;;) diff --git a/test/dump/getlocal.txt b/test/dump/getlocal.txt index 10f0ca23..d22cb2ca 100644 --- a/test/dump/getlocal.txt +++ b/test/dump/getlocal.txt @@ -22,7 +22,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -53,8 +53,4 @@ 000002a: 03 ; remapped local index 0000019: 1000 ; FIXUP func body size 000002b: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0500 0000 0000 ................ -0000010: 0002 0002 0002 0002 0010 000e 060e 040e ................ -0000020: 020e 000e 010e 050e 070e 0306 ............ ;;; STDOUT ;;) diff --git a/test/dump/global-multi.txt b/test/dump/global-multi.txt index 1ba660c7..59af5bbb 100644 --- a/test/dump/global-multi.txt +++ b/test/dump/global-multi.txt @@ -24,11 +24,5 @@ 0000018: 0000 0000 ; global name offset 000001c: 09 ; global mem type 000001d: 00 ; export global -000001e: 01 ; WASM_SECTION_SIGNATURES -000001f: 00 ; num signatures -0000020: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0304 0000 0000 0400 0000 0000 ................ -0000010: 0600 0000 0000 0800 0000 0000 0900 0100 ................ -0000020: 06 . +000001e: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/if.txt b/test/dump/if.txt index 3e69c067..408d2101 100644 --- a/test/dump/if.txt +++ b/test/dump/if.txt @@ -13,7 +13,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 02 ; num functions @@ -26,31 +26,24 @@ 0000014: 09 ; OPCODE_I8_CONST 0000015: 01 ; u8 literal 0000016: 00 ; OPCODE_NOP -0000017: 03 ; OPCODE_IF +0000017: 04 ; OPCODE_IF_THEN 0000018: 09 ; OPCODE_I8_CONST 0000019: 00 ; u8 literal 000001a: 0d ; OPCODE_F32_CONST 000001b: 0000 803f ; f32 literal 000001f: 0d ; OPCODE_F32_CONST 0000020: 0000 0040 ; f32 literal -0000017: 04 ; FIXUP OPCODE_IF_THEN 0000011: 1100 ; FIXUP func body size ; function 1 0000024: 01 ; func flags 0000025: 0000 ; func signature index 0000027: 0000 0000 ; func name offset 000002b: 0000 ; func body size -000002d: 03 ; OPCODE_IF +000002d: 04 ; OPCODE_IF_THEN 000002e: 09 ; OPCODE_I8_CONST 000002f: 01 ; u8 literal 0000030: 14 ; OPCODE_RETURN 0000031: 14 ; OPCODE_RETURN -000002d: 04 ; FIXUP OPCODE_IF_THEN 000002b: 0500 ; FIXUP func body size 0000032: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0202 0100 0000 0000 ................ -0000010: 0011 0003 0901 0004 0900 0d00 0080 3f0d ..............?. -0000020: 0000 0040 0100 0000 0000 0005 0004 0901 ...@............ -0000030: 1414 06 ... ;;; STDOUT ;;) diff --git a/test/dump/import.txt b/test/dump/import.txt index 7fc3208e..71da48ef 100644 --- a/test/dump/import.txt +++ b/test/dump/import.txt @@ -11,16 +11,16 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 02 ; num signatures ; signature 0 -0000006: 04 ; num args +0000006: 04 ; num params 0000007: 00 ; result_type -0000008: 01 ; arg type -0000009: 02 ; arg type -000000a: 03 ; arg type -000000b: 04 ; arg type +0000008: 01 ; param type +0000009: 02 ; param type +000000a: 03 ; param type +000000b: 04 ; param type ; signature 1 -000000c: 01 ; num args +000000c: 01 ; num params 000000d: 01 ; result_type -000000e: 01 ; arg type +000000e: 01 ; param type 000000f: 02 ; WASM_SECTION_FUNCTIONS 0000010: 02 ; num functions ; import header 0 @@ -32,12 +32,12 @@ 0000019: 0100 ; import signature index 000001b: 0000 0000 ; import name offset 000001f: 06 ; WASM_SECTION_END -; names +; import 0 0000014: 2000 0000 ; FIXUP import name offset -0000020: 7465 7374 00 ; import name +0000020: 7465 7374 ; import name +0000024: 00 ; \0 +; import 1 000001b: 2500 0000 ; FIXUP import name offset -0000025: 7465 7374 3200 ; import name -0000000: 0000 0001 0102 0400 0102 0304 0101 0102 ................ -0000010: 0203 0000 2000 0000 0301 0025 0000 0006 .... ......%.... -0000020: 7465 7374 0074 6573 7432 00 test.test2. +0000025: 7465 7374 32 ; import name +000002a: 00 ; \0 ;;; STDOUT ;;) diff --git a/test/dump/load-aligned.txt b/test/dump/load-aligned.txt index 187a0725..c6c3b5e9 100644 --- a/test/dump/load-aligned.txt +++ b/test/dump/load-aligned.txt @@ -43,7 +43,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -166,14 +166,4 @@ 0000082: 00 ; u8 literal 0000011: 7000 ; FIXUP func body size 0000083: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0070 0020 0009 0020 0009 0020 0009 0020 .p. ... ... ... -0000020: 0009 0022 0009 0022 0009 0022 0009 0022 ..."..."..."..." -0000030: 0009 002a 0009 002a 0009 002a 0009 002a ...*...*...*...* -0000040: 0009 002b 0009 002b 0009 002b 0009 002b ...+...+...+...+ -0000050: 0009 0024 0009 0024 0009 0024 0009 0024 ...$...$...$...$ -0000060: 0009 0026 0009 0026 0009 0026 0009 0026 ...&...&...&...& -0000070: 0009 0028 0009 0028 0009 0028 0009 0028 ...(...(...(...( -0000080: 0009 0006 .... ;;; STDOUT ;;) diff --git a/test/dump/load.txt b/test/dump/load.txt index 675f7a07..effb27e8 100644 --- a/test/dump/load.txt +++ b/test/dump/load.txt @@ -23,7 +23,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -90,10 +90,4 @@ 000004a: 00 ; u8 literal 0000011: 3800 ; FIXUP func body size 000004b: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0038 002a 0009 0020 0009 0022 0009 0021 .8.*... ..."...! -0000020: 0009 0023 0009 002b 0009 0024 0009 0026 ...#...+...$...& -0000030: 0009 0028 0009 0025 0009 0027 0009 0029 ...(...%...'...) -0000040: 0009 002c 0009 002d 0009 0006 ...,...-.... ;;; STDOUT ;;) diff --git a/test/dump/loadglobal.txt b/test/dump/loadglobal.txt index d6ddca4e..752df72f 100644 --- a/test/dump/loadglobal.txt +++ b/test/dump/loadglobal.txt @@ -32,7 +32,7 @@ 000001e: 01 ; WASM_SECTION_SIGNATURES 000001f: 01 ; num signatures ; signature 0 -0000020: 00 ; num args +0000020: 00 ; num params 0000021: 00 ; result_type 0000022: 02 ; WASM_SECTION_FUNCTIONS 0000023: 01 ; num functions @@ -41,19 +41,14 @@ 0000025: 0000 ; func signature index 0000027: 0000 0000 ; func name offset 000002b: 0000 ; func body size -000002d: 10 ; OPCODE_GET_GLOBAL +000002d: 10 ; OPCODE_LOAD_GLOBAL 000002e: 00 ; global index -000002f: 10 ; OPCODE_GET_GLOBAL +000002f: 10 ; OPCODE_LOAD_GLOBAL 0000030: 01 ; global index -0000031: 10 ; OPCODE_GET_GLOBAL +0000031: 10 ; OPCODE_LOAD_GLOBAL 0000032: 02 ; global index -0000033: 10 ; OPCODE_GET_GLOBAL +0000033: 10 ; OPCODE_LOAD_GLOBAL 0000034: 03 ; global index 000002b: 0800 ; FIXUP func body size 0000035: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0304 0000 0000 0400 0000 0000 ................ -0000010: 0600 0000 0000 0800 0000 0000 0900 0101 ................ -0000020: 0000 0201 0100 0000 0000 0008 0010 0010 ................ -0000030: 0110 0210 0306 ...... ;;; STDOUT ;;) diff --git a/test/dump/locals.txt b/test/dump/locals.txt index afb659db..f35d88fa 100644 --- a/test/dump/locals.txt +++ b/test/dump/locals.txt @@ -9,7 +9,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -24,7 +24,4 @@ 0000019: 0000 ; func body size 0000019: 0000 ; FIXUP func body size 000001b: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0500 0000 0000 ................ -0000010: 0001 0002 0003 0004 0000 0006 ............ ;;; STDOUT ;;) diff --git a/test/dump/loop.txt b/test/dump/loop.txt index 4acd7813..b0ca3de0 100644 --- a/test/dump/loop.txt +++ b/test/dump/loop.txt @@ -12,7 +12,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -22,13 +22,9 @@ 000000d: 0000 0000 ; func name offset 0000011: 0000 ; func body size 0000013: 02 ; OPCODE_LOOP -0000014: 00 ; num expressions +0000014: 02 ; num expressions 0000015: 00 ; OPCODE_NOP 0000016: 00 ; OPCODE_NOP -0000014: 02 ; FIXUP num expressions 0000011: 0400 ; FIXUP func body size 0000017: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0004 0002 0200 0006 ........ ;;; STDOUT ;;) diff --git a/test/dump/memory-data-size.txt b/test/dump/memory-data-size.txt index c891ac1a..7c61bb47 100644 --- a/test/dump/memory-data-size.txt +++ b/test/dump/memory-data-size.txt @@ -8,100 +8,20 @@ 0000001: 07 ; min mem size log 2 0000002: 07 ; max mem size log 2 0000003: 01 ; export mem -0000004: 01 ; WASM_SECTION_SIGNATURES -0000005: 05 ; num signatures -; assert signature 0 -0000006: 00 ; num args -0000007: 00 ; result_type -; assert signature 1 -0000008: 00 ; num args -0000009: 01 ; result_type -; assert signature 2 -000000a: 00 ; num args -000000b: 02 ; result_type -; assert signature 3 -000000c: 00 ; num args -000000d: 03 ; result_type -; assert signature 4 -000000e: 00 ; num args -000000f: 04 ; result_type -0000010: 06 ; WASM_SECTION_END -; names -0000000: 0007 0701 0105 0000 0001 0002 0003 0004 ................ -0000010: 06 . +0000004: 06 ; WASM_SECTION_END 0000000: 00 ; WASM_SECTION_MEMORY 0000001: 08 ; min mem size log 2 0000002: 08 ; max mem size log 2 0000003: 01 ; export mem -0000004: 01 ; WASM_SECTION_SIGNATURES -0000005: 05 ; num signatures -; assert signature 0 -0000006: 00 ; num args -0000007: 00 ; result_type -; assert signature 1 -0000008: 00 ; num args -0000009: 01 ; result_type -; assert signature 2 -000000a: 00 ; num args -000000b: 02 ; result_type -; assert signature 3 -000000c: 00 ; num args -000000d: 03 ; result_type -; assert signature 4 -000000e: 00 ; num args -000000f: 04 ; result_type -0000010: 06 ; WASM_SECTION_END -; names -0000000: 0008 0801 0105 0000 0001 0002 0003 0004 ................ -0000010: 06 . +0000004: 06 ; WASM_SECTION_END 0000000: 00 ; WASM_SECTION_MEMORY 0000001: 09 ; min mem size log 2 0000002: 09 ; max mem size log 2 0000003: 01 ; export mem -0000004: 01 ; WASM_SECTION_SIGNATURES -0000005: 05 ; num signatures -; assert signature 0 -0000006: 00 ; num args -0000007: 00 ; result_type -; assert signature 1 -0000008: 00 ; num args -0000009: 01 ; result_type -; assert signature 2 -000000a: 00 ; num args -000000b: 02 ; result_type -; assert signature 3 -000000c: 00 ; num args -000000d: 03 ; result_type -; assert signature 4 -000000e: 00 ; num args -000000f: 04 ; result_type -0000010: 06 ; WASM_SECTION_END -; names -0000000: 0009 0901 0105 0000 0001 0002 0003 0004 ................ -0000010: 06 . +0000004: 06 ; WASM_SECTION_END 0000000: 00 ; WASM_SECTION_MEMORY 0000001: 0a ; min mem size log 2 0000002: 0a ; max mem size log 2 0000003: 01 ; export mem -0000004: 01 ; WASM_SECTION_SIGNATURES -0000005: 05 ; num signatures -; assert signature 0 -0000006: 00 ; num args -0000007: 00 ; result_type -; assert signature 1 -0000008: 00 ; num args -0000009: 01 ; result_type -; assert signature 2 -000000a: 00 ; num args -000000b: 02 ; result_type -; assert signature 3 -000000c: 00 ; num args -000000d: 03 ; result_type -; assert signature 4 -000000e: 00 ; num args -000000f: 04 ; result_type -0000010: 06 ; WASM_SECTION_END -; names -0000000: 000a 0a01 0105 0000 0001 0002 0003 0004 ................ -0000010: 06 . +0000004: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/memory-hex.txt b/test/dump/memory-hex.txt index e15e6dae..47305a88 100644 --- a/test/dump/memory-hex.txt +++ b/test/dump/memory-hex.txt @@ -14,14 +14,8 @@ 000000a: 0000 0000 ; segment data offset 000000e: 0b00 0000 ; segment size 0000012: 01 ; segment init -0000013: 01 ; WASM_SECTION_SIGNATURES -0000014: 00 ; num signatures -0000015: 06 ; WASM_SECTION_END +0000013: 06 ; WASM_SECTION_END ; segment data 0 -000000a: 1600 0000 ; FIXUP segment data offset -0000016: 0001 0203 0405 0607 0809 0a ........... ; segment data -; names -0000000: 0007 0701 0401 0000 0000 1600 0000 0b00 ................ -0000010: 0000 0101 0006 0001 0203 0405 0607 0809 ................ -0000020: 0a . +000000a: 1400 0000 ; FIXUP segment data offset +0000014: 0001 0203 0405 0607 0809 0a ; segment data ;;; STDOUT ;;) diff --git a/test/dump/memory-size.txt b/test/dump/memory-size.txt index be841133..98db1f6e 100644 --- a/test/dump/memory-size.txt +++ b/test/dump/memory-size.txt @@ -11,7 +11,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 01 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -20,11 +20,7 @@ 000000b: 0000 ; func signature index 000000d: 0000 0000 ; func name offset 0000011: 0000 ; func body size -0000013: 09 ; OPCODE_I8_CONST -0000014: 00 ; zero -0000011: 0200 ; FIXUP func body size -0000015: 06 ; WASM_SECTION_END -; names -0000000: 000a 0a01 0101 0001 0201 0100 0000 0000 ................ -0000010: 0002 0009 0006 ...... +0000013: 3b ; OPCODE_MEMORY_SIZE +0000011: 0100 ; FIXUP func body size +0000014: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/memory.txt b/test/dump/memory.txt index 55019ba3..81112147 100644 --- a/test/dump/memory.txt +++ b/test/dump/memory.txt @@ -18,17 +18,11 @@ 0000017: 0000 0000 ; segment data offset 000001b: 0700 0000 ; segment size 000001f: 01 ; segment init -0000020: 01 ; WASM_SECTION_SIGNATURES -0000021: 00 ; num signatures -0000022: 06 ; WASM_SECTION_END +0000020: 06 ; WASM_SECTION_END ; segment data 0 -000000a: 2300 0000 ; FIXUP segment data offset -0000023: 6865 6c6c 6f hello ; segment data +000000a: 2100 0000 ; FIXUP segment data offset +0000021: 6865 6c6c 6f ; segment data ; segment data 1 -0000017: 2800 0000 ; FIXUP segment data offset -0000028: 676f 6f64 6279 65 goodbye ; segment data -; names -0000000: 0007 0701 0402 0a00 0000 2300 0000 0500 ..........#..... -0000010: 0000 0114 0000 0028 0000 0007 0000 0001 .......(........ -0000020: 0100 0668 656c 6c6f 676f 6f64 6279 65 ...hellogoodbye +0000017: 2600 0000 ; FIXUP segment data offset +0000026: 676f 6f64 6279 65 ; segment data ;;; STDOUT ;;) diff --git a/test/dump/nop.txt b/test/dump/nop.txt index 55f02a9b..7e45307a 100644 --- a/test/dump/nop.txt +++ b/test/dump/nop.txt @@ -9,7 +9,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -21,7 +21,4 @@ 0000013: 00 ; OPCODE_NOP 0000011: 0100 ; FIXUP func body size 0000014: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0001 0000 06 ..... ;;; STDOUT ;;) diff --git a/test/dump/param-multi.txt b/test/dump/param-multi.txt index 64a94f06..e03cf543 100644 --- a/test/dump/param-multi.txt +++ b/test/dump/param-multi.txt @@ -9,12 +9,12 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 04 ; num args +0000006: 04 ; num params 0000007: 00 ; result_type -0000008: 01 ; arg type -0000009: 02 ; arg type -000000a: 03 ; arg type -000000b: 04 ; arg type +0000008: 01 ; param type +0000009: 02 ; param type +000000a: 03 ; param type +000000b: 04 ; param type 000000c: 02 ; WASM_SECTION_FUNCTIONS 000000d: 01 ; num functions ; function 0 @@ -24,7 +24,4 @@ 0000015: 0000 ; func body size 0000015: 0000 ; FIXUP func body size 0000017: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0400 0102 0304 0201 0100 ................ -0000010: 0000 0000 0000 0006 ........ ;;; STDOUT ;;) diff --git a/test/dump/resize-memory.txt b/test/dump/resize-memory.txt index b3996227..f71d305b 100644 --- a/test/dump/resize-memory.txt +++ b/test/dump/resize-memory.txt @@ -11,9 +11,9 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 01 ; num args +0000006: 01 ; num params 0000007: 00 ; result_type -0000008: 01 ; arg type +0000008: 01 ; param type 0000009: 02 ; WASM_SECTION_FUNCTIONS 000000a: 01 ; num functions ; function 0 @@ -21,12 +21,9 @@ 000000c: 0000 ; func signature index 000000e: 0000 0000 ; func name offset 0000012: 0000 ; func body size -0000014: 39 ; OPCODE_RESIZE_MEMORY_I32 +0000014: 39 ; OPCODE_RESIZE_MEM_L 0000015: 0e ; OPCODE_GET_LOCAL 0000016: 00 ; remapped local index 0000012: 0300 ; FIXUP func body size 0000017: 06 ; WASM_SECTION_END -; names -0000000: 0008 0a01 0101 0100 0102 0101 0000 0000 ................ -0000010: 0000 0300 390e 0006 ....9... ;;; STDOUT ;;) diff --git a/test/dump/result.txt b/test/dump/result.txt index bce4cb29..b461f5c4 100644 --- a/test/dump/result.txt +++ b/test/dump/result.txt @@ -12,16 +12,16 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 04 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 01 ; result_type ; signature 1 -0000008: 00 ; num args +0000008: 00 ; num params 0000009: 02 ; result_type ; signature 2 -000000a: 00 ; num args +000000a: 00 ; num params 000000b: 03 ; result_type ; signature 3 -000000c: 00 ; num args +000000c: 00 ; num params 000000d: 04 ; result_type 000000e: 02 ; WASM_SECTION_FUNCTIONS 000000f: 04 ; num functions @@ -58,10 +58,4 @@ 0000045: 0000 0000 0000 0000 ; f64 literal 0000042: 0900 ; FIXUP func body size 000004d: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0104 0001 0002 0003 0004 0204 ................ -0000010: 0100 0000 0000 0002 0009 0001 0100 0000 ................ -0000020: 0000 0900 0b00 0000 0000 0000 0001 0200 ................ -0000030: 0000 0000 0500 0d00 0000 0001 0300 0000 ................ -0000040: 0000 0900 0c00 0000 0000 0000 0006 .............. ;;; STDOUT ;;) diff --git a/test/dump/return.txt b/test/dump/return.txt index 466b3ec2..bccf3ff5 100644 --- a/test/dump/return.txt +++ b/test/dump/return.txt @@ -11,10 +11,10 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 02 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 01 ; result_type ; signature 1 -0000008: 00 ; num args +0000008: 00 ; num params 0000009: 00 ; result_type 000000a: 02 ; WASM_SECTION_FUNCTIONS 000000b: 02 ; num functions @@ -35,8 +35,4 @@ 0000021: 14 ; OPCODE_RETURN 000001f: 0100 ; FIXUP func body size 0000022: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0102 0001 0000 0202 0100 0000 ................ -0000010: 0000 0003 0014 092a 0101 0000 0000 0001 .......*........ -0000020: 0014 06 ... ;;; STDOUT ;;) diff --git a/test/dump/select.txt b/test/dump/select.txt index f118778f..3c669b29 100644 --- a/test/dump/select.txt +++ b/test/dump/select.txt @@ -13,7 +13,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -52,11 +52,4 @@ 0000049: 0000 0000 0000 0840 ; f64 literal 0000011: 3e00 ; FIXUP func body size 0000051: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 003e 0005 0901 0902 0903 0509 010b 0200 .>.............. -0000020: 0000 0000 0000 0b03 0000 0000 0000 0005 ................ -0000030: 0901 0d00 0000 400d 0000 4040 0509 010c ......@...@@.... -0000040: 0000 0000 0000 0040 0c00 0000 0000 0008 .......@........ -0000050: 4006 @. ;;; STDOUT ;;) diff --git a/test/dump/setlocal-param.txt b/test/dump/setlocal-param.txt index fd7a8ca0..b40efea5 100644 --- a/test/dump/setlocal-param.txt +++ b/test/dump/setlocal-param.txt @@ -20,10 +20,10 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 02 ; num args +0000006: 02 ; num params 0000007: 00 ; result_type -0000008: 01 ; arg type -0000009: 03 ; arg type +0000008: 01 ; param type +0000009: 03 ; param type 000000a: 02 ; WASM_SECTION_FUNCTIONS 000000b: 01 ; num functions ; function 0 @@ -61,10 +61,4 @@ 0000041: 0000 0000 ; f32 literal 000001b: 2800 ; FIXUP func body size 0000045: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0200 0103 0201 0500 0000 ................ -0000010: 0000 0001 0001 0002 0000 0028 000f 0009 ...........(.... -0000020: 000f 010d 0000 0000 0f03 0b00 0000 0000 ................ -0000030: 0000 000f 040d 0000 0000 0f02 0900 0f05 ................ -0000040: 0d00 0000 0006 ...... ;;; STDOUT ;;) diff --git a/test/dump/setlocal.txt b/test/dump/setlocal.txt index 2bec4bb9..07170b5a 100644 --- a/test/dump/setlocal.txt +++ b/test/dump/setlocal.txt @@ -22,7 +22,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -69,11 +69,4 @@ 0000055: 0000 0000 0000 0000 ; u64 literal 0000019: 4200 ; FIXUP func body size 000005d: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0500 0000 0000 ................ -0000010: 0002 0002 0002 0002 0042 000f 060c 0000 .........B...... -0000020: 0000 0000 0000 0f04 0d00 0000 000f 020b ................ -0000030: 0000 0000 0000 0000 0f00 0900 0f01 0900 ................ -0000040: 0f05 0d00 0000 000f 070c 0000 0000 0000 ................ -0000050: 0000 0f03 0b00 0000 0000 0000 0006 .............. ;;; STDOUT ;;) diff --git a/test/dump/signatures.txt b/test/dump/signatures.txt index a8513ace..d1d74d4d 100644 --- a/test/dump/signatures.txt +++ b/test/dump/signatures.txt @@ -19,39 +19,36 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 09 ; num signatures ; signature 0 -0000006: 01 ; num args +0000006: 01 ; num params 0000007: 00 ; result_type -0000008: 01 ; arg type +0000008: 01 ; param type ; signature 1 -0000009: 01 ; num args +0000009: 01 ; num params 000000a: 00 ; result_type -000000b: 02 ; arg type +000000b: 02 ; param type ; signature 2 -000000c: 01 ; num args +000000c: 01 ; num params 000000d: 00 ; result_type -000000e: 03 ; arg type +000000e: 03 ; param type ; signature 3 -000000f: 01 ; num args +000000f: 01 ; num params 0000010: 00 ; result_type -0000011: 04 ; arg type +0000011: 04 ; param type ; signature 4 -0000012: 00 ; num args +0000012: 00 ; num params 0000013: 01 ; result_type ; signature 5 -0000014: 00 ; num args +0000014: 00 ; num params 0000015: 02 ; result_type ; signature 6 -0000016: 00 ; num args +0000016: 00 ; num params 0000017: 03 ; result_type ; signature 7 -0000018: 00 ; num args +0000018: 00 ; num params 0000019: 04 ; result_type ; signature 8 -000001a: 01 ; num args +000001a: 01 ; num params 000001b: 04 ; result_type -000001c: 01 ; arg type +000001c: 01 ; param type 000001d: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0109 0100 0101 0002 0100 0301 ................ -0000010: 0004 0001 0002 0003 0004 0104 0106 .............. ;;; STDOUT ;;) diff --git a/test/dump/store-aligned.txt b/test/dump/store-aligned.txt index 65923f66..667e092c 100644 --- a/test/dump/store-aligned.txt +++ b/test/dump/store-aligned.txt @@ -43,7 +43,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -222,24 +222,4 @@ 0000123: 0000 0000 0000 0000 ; u64 literal 0000011: 1801 ; FIXUP func body size 000012b: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0018 012e 0009 0009 002e 0009 0009 002e ................ -0000020: 0009 0009 002e 0009 0009 002f 0009 0009 .........../.... -0000030: 002f 0009 0009 002f 0009 0009 002f 0009 ./...../...../.. -0000040: 0009 0033 0009 0009 0033 0009 0009 0033 ...3.....3.....3 -0000050: 0009 0009 0033 0009 0009 0034 0009 000b .....3.....4.... -0000060: 0000 0000 0000 0000 3400 0900 0b00 0000 ........4....... -0000070: 0000 0000 0034 0009 000b 0000 0000 0000 .....4.......... -0000080: 0000 3400 0900 0b00 0000 0000 0000 0030 ..4............0 -0000090: 0009 000b 0000 0000 0000 0000 3000 0900 ............0... -00000a0: 0b00 0000 0000 0000 0030 0009 000b 0000 .........0...... -00000b0: 0000 0000 0000 3000 0900 0b00 0000 0000 ......0......... -00000c0: 0000 0031 0009 000b 0000 0000 0000 0000 ...1............ -00000d0: 3100 0900 0b00 0000 0000 0000 0031 0009 1............1.. -00000e0: 000b 0000 0000 0000 0000 3100 0900 0b00 ..........1..... -00000f0: 0000 0000 0000 0034 0009 000b 0000 0000 .......4........ -0000100: 0000 0000 3400 0900 0b00 0000 0000 0000 ....4........... -0000110: 0034 0009 000b 0000 0000 0000 0000 3400 .4............4. -0000120: 0900 0b00 0000 0000 0000 0006 ............ ;;; STDOUT ;;) diff --git a/test/dump/store.txt b/test/dump/store.txt index 9eb799fb..134a5fce 100644 --- a/test/dump/store.txt +++ b/test/dump/store.txt @@ -18,7 +18,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -83,12 +83,4 @@ 0000067: 0000 0000 0000 0000 ; f64 literal 0000011: 5c00 ; FIXUP func body size 000006f: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 005c 002e 0009 0009 002f 0009 0009 0033 .\......./.....3 -0000020: 0009 0009 0034 0009 000b 0000 0000 0000 .....4.......... -0000030: 0000 3000 0900 0b00 0000 0000 0000 0031 ..0............1 -0000040: 0009 000b 0000 0000 0000 0000 3200 0900 ............2... -0000050: 0b00 0000 0000 0000 0035 0009 000d 0000 .........5...... -0000060: 0000 3600 0900 0c00 0000 0000 0000 0006 ..6............. ;;; STDOUT ;;) diff --git a/test/dump/storeglobal.txt b/test/dump/storeglobal.txt index 252524cc..b6e73b4f 100644 --- a/test/dump/storeglobal.txt +++ b/test/dump/storeglobal.txt @@ -32,7 +32,7 @@ 000001e: 01 ; WASM_SECTION_SIGNATURES 000001f: 01 ; num signatures ; signature 0 -0000020: 00 ; num args +0000020: 00 ; num params 0000021: 00 ; result_type 0000022: 02 ; WASM_SECTION_FUNCTIONS 0000023: 01 ; num functions @@ -41,28 +41,22 @@ 0000025: 0000 ; func signature index 0000027: 0000 0000 ; func name offset 000002b: 0000 ; func body size -000002d: 11 ; OPCODE_SET_GLOBAL +000002d: 11 ; OPCODE_STORE_GLOBAL 000002e: 00 ; global index 000002f: 09 ; OPCODE_I8_CONST 0000030: 00 ; u8 literal -0000031: 11 ; OPCODE_SET_GLOBAL +0000031: 11 ; OPCODE_STORE_GLOBAL 0000032: 01 ; global index 0000033: 0b ; OPCODE_I64_CONST 0000034: 0100 0000 0000 0000 ; u64 literal -000003c: 11 ; OPCODE_SET_GLOBAL +000003c: 11 ; OPCODE_STORE_GLOBAL 000003d: 02 ; global index 000003e: 0d ; OPCODE_F32_CONST 000003f: 0000 0040 ; f32 literal -0000043: 11 ; OPCODE_SET_GLOBAL +0000043: 11 ; OPCODE_STORE_GLOBAL 0000044: 03 ; global index 0000045: 0c ; OPCODE_F64_CONST 0000046: 0000 0000 0000 0840 ; f64 literal 000002b: 2100 ; FIXUP func body size 000004e: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0304 0000 0000 0400 0000 0000 ................ -0000010: 0600 0000 0000 0800 0000 0000 0900 0101 ................ -0000020: 0000 0201 0100 0000 0000 0021 0011 0009 ...........!.... -0000030: 0011 010b 0100 0000 0000 0000 1102 0d00 ................ -0000040: 0000 4011 030c 0000 0000 0000 0840 06 ..@..........@. ;;; STDOUT ;;) diff --git a/test/dump/table.txt b/test/dump/table.txt index 259750c1..6ce77291 100644 --- a/test/dump/table.txt +++ b/test/dump/table.txt @@ -13,16 +13,16 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 03 ; num signatures ; signature 0 -0000006: 01 ; num args +0000006: 01 ; num params 0000007: 00 ; result_type -0000008: 01 ; arg type +0000008: 01 ; param type ; signature 1 -0000009: 02 ; num args +0000009: 02 ; num params 000000a: 00 ; result_type -000000b: 01 ; arg type -000000c: 02 ; arg type +000000b: 01 ; param type +000000c: 02 ; param type ; signature 2 -000000d: 00 ; num args +000000d: 00 ; num params 000000e: 04 ; result_type 000000f: 02 ; WASM_SECTION_FUNCTIONS 0000010: 03 ; num functions @@ -53,9 +53,4 @@ 000003b: 0100 ; function table entry 000003d: 0200 ; function table entry 000003f: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0103 0100 0102 0001 0200 0402 ................ -0000010: 0301 0000 0000 0000 0000 0101 0000 0000 ................ -0000020: 0000 0001 0200 0000 0000 0900 0c00 0000 ................ -0000030: 0000 0000 0005 0400 0000 0001 0002 0006 ................ ;;; STDOUT ;;) diff --git a/test/dump/tableswitch.txt b/test/dump/tableswitch.txt index 22843609..09dfa1b9 100644 --- a/test/dump/tableswitch.txt +++ b/test/dump/tableswitch.txt @@ -15,7 +15,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -27,29 +27,22 @@ 0000013: 01 ; OPCODE_BLOCK 0000014: 01 ; num expressions 0000015: 08 ; OPCODE_TABLESWITCH -0000016: 0000 ; num targets -0000018: 0000 ; num cases +0000016: 0300 ; num targets +0000018: 0300 ; num cases 000001a: 0000 ; case index 000001c: 0100 ; case index 000001e: 0080 ; br depth -0000018: 0300 ; FIXUP num cases 0000020: 09 ; OPCODE_I8_CONST 0000021: 00 ; u8 literal -0000022: 09 ; OPCODE_I8_CONST -0000023: 01 ; u8 literal +0000022: 01 ; OPCODE_BLOCK +0000023: 02 ; num expressions 0000024: 09 ; OPCODE_I8_CONST -0000025: 02 ; u8 literal -; move [0000022,0000026) -> [0000024,0000028) -0000022: 01 ; WASM_OPCODE_BLOCK -0000023: 02 ; num exprs +0000025: 01 ; u8 literal +0000026: 09 ; OPCODE_I8_CONST +0000027: 02 ; u8 literal 0000028: 00 ; WASM_OPCODE_NOP for fallthrough 0000029: 09 ; OPCODE_I8_CONST 000002a: 03 ; u8 literal -0000016: 0300 ; FIXUP num targets 0000011: 1800 ; FIXUP func body size 000002b: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0018 0001 0108 0300 0300 0000 0100 0080 ................ -0000020: 0900 0102 0901 0902 0009 0306 ............ ;;; STDOUT ;;) diff --git a/test/dump/unary.txt b/test/dump/unary.txt index f2374ed4..43475cbf 100644 --- a/test/dump/unary.txt +++ b/test/dump/unary.txt @@ -33,7 +33,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -42,7 +42,7 @@ 000000b: 0000 ; func signature index 000000d: 0000 0000 ; func name offset 0000011: 0000 ; func body size -0000013: 5a ; OPCODE_I32_NOT +0000013: 5a ; OPCODE_BOOL_NOT 0000014: 57 ; OPCODE_I32_CLZ 0000015: 58 ; OPCODE_I32_CTZ 0000016: 59 ; OPCODE_I32_POPCNT @@ -59,7 +59,7 @@ 0000028: 7e ; OPCODE_F32_CEIL 0000029: 7f ; OPCODE_F32_FLOOR 000002a: 80 ; OPCODE_F32_TRUNC -000002b: 81 ; OPCODE_F32_NEAREST +000002b: 81 ; OPCODE_F32_NEAREST_INT 000002c: 0d ; OPCODE_F32_CONST 000002d: 0000 0000 ; f32 literal 0000031: 90 ; OPCODE_F64_NEG @@ -68,15 +68,9 @@ 0000034: 92 ; OPCODE_F64_CEIL 0000035: 93 ; OPCODE_F64_FLOOR 0000036: 94 ; OPCODE_F64_TRUNC -0000037: 95 ; OPCODE_F64_NEAREST +0000037: 95 ; OPCODE_F64_NEAREST_INT 0000038: 0c ; OPCODE_F64_CONST 0000039: 0000 0000 0000 0000 ; f64 literal 0000011: 2e00 ; FIXUP func body size 0000041: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 002e 005a 5758 5909 0072 7374 0b00 0000 ...ZWXY..rst.... -0000020: 0000 0000 007c 7b82 7e7f 8081 0d00 0000 .....|{.~....... -0000030: 0090 8f96 9293 9495 0c00 0000 0000 0000 ................ -0000040: 0006 .. ;;; STDOUT ;;) diff --git a/test/dump/unreachable.txt b/test/dump/unreachable.txt index bd99c6b7..a79240f1 100644 --- a/test/dump/unreachable.txt +++ b/test/dump/unreachable.txt @@ -10,7 +10,7 @@ 0000004: 01 ; WASM_SECTION_SIGNATURES 0000005: 01 ; num signatures ; signature 0 -0000006: 00 ; num args +0000006: 00 ; num params 0000007: 00 ; result_type 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions @@ -22,7 +22,4 @@ 0000013: 15 ; OPCODE_UNREACHABLE 0000011: 0100 ; FIXUP func body size 0000014: 06 ; WASM_SECTION_END -; names -0000000: 0000 0001 0101 0000 0201 0100 0000 0000 ................ -0000010: 0001 0015 06 ..... ;;; STDOUT ;;) diff --git a/test/expr/brif-named.txt b/test/expr/brif-named.txt index 625342ae..03f75691 100644 --- a/test/expr/brif-named.txt +++ b/test/expr/brif-named.txt @@ -1,4 +1,4 @@ (module (func (block $foo - (br_if (i32.const 1) $foo)))) + (br_if $foo (i32.const 1))))) diff --git a/test/expr/brif.txt b/test/expr/brif.txt index 5be1cdcb..1537232b 100644 --- a/test/expr/brif.txt +++ b/test/expr/brif.txt @@ -1,4 +1,4 @@ (module (func (label $foo - (br_if (i32.const 1) 0)))) + (br_if 0 (i32.const 1))))) |