diff options
author | Ben Smith <binji@chromium.org> | 2016-12-08 15:18:37 -0800 |
---|---|---|
committer | Ben Smith <binji@chromium.org> | 2016-12-09 16:08:28 -0800 |
commit | c025829d6cccfbd2ac94782beebbbee0c0389675 (patch) | |
tree | 24ce9cdc161642906f9895a34934f7e2a43e20aa | |
parent | 3918cc61718aee6301c24f71eda0688d8fba284b (diff) | |
download | wabt-c025829d6cccfbd2ac94782beebbbee0c0389675.tar.gz wabt-c025829d6cccfbd2ac94782beebbbee0c0389675.tar.bz2 wabt-c025829d6cccfbd2ac94782beebbbee0c0389675.zip |
Update testsuite
* Non-imported globals can not be used in initializer expressions
* block/loop/if labels can be repeated at the end
* get_global index in initializer expression should reference use module
index space, not "defined" global index space
-rw-r--r-- | src/ast-parser.y | 34 | ||||
-rw-r--r-- | src/binary-reader-interpreter.c | 2 | ||||
-rw-r--r-- | src/prebuilt/ast-parser-gen.c | 1372 | ||||
-rw-r--r-- | src/validator.c | 12 | ||||
-rw-r--r-- | test/dump/global.txt | 151 | ||||
-rw-r--r-- | test/parse/expr/bad-block-end-label.txt | 10 | ||||
-rw-r--r-- | test/parse/expr/bad-block-mismatch-label.txt | 10 | ||||
-rw-r--r-- | test/parse/expr/bad-if-end-label.txt | 15 | ||||
-rw-r--r-- | test/parse/expr/bad-if-mismatch-label.txt | 15 | ||||
-rw-r--r-- | test/parse/expr/bad-loop-end-label.txt | 10 | ||||
-rw-r--r-- | test/parse/expr/bad-loop-mismatch-label.txt | 10 | ||||
-rw-r--r-- | test/parse/module/data-offset.txt | 3 | ||||
-rw-r--r-- | test/parse/module/elem-offset.txt | 3 | ||||
-rw-r--r-- | test/parse/module/global.txt | 5 | ||||
-rw-r--r-- | test/spec/binary.txt | 42 | ||||
-rw-r--r-- | test/spec/float_misc.txt | 2 | ||||
-rw-r--r-- | test/spec/globals.txt | 4 | ||||
-rw-r--r-- | test/spec/imports.txt | 133 | ||||
-rw-r--r-- | test/spec/memory.txt | 82 | ||||
-rw-r--r-- | test/typecheck/bad-global-getglobal-type-mismatch.txt | 2 | ||||
m--------- | third_party/testsuite | 0 |
21 files changed, 1047 insertions, 870 deletions
diff --git a/src/ast-parser.y b/src/ast-parser.y index 4989c0d5..d31143ff 100644 --- a/src/ast-parser.y +++ b/src/ast-parser.y @@ -109,6 +109,25 @@ } \ } while (0) +#define CHECK_END_LABEL(loc, begin_label, end_label) \ + do { \ + if (!wasm_string_slice_is_empty(&(end_label))) { \ + if (wasm_string_slice_is_empty(&(begin_label))) { \ + wasm_ast_parser_error(&loc, lexer, parser, \ + "unexpected label \"" PRIstringslice "\"", \ + WASM_PRINTF_STRING_SLICE_ARG(end_label)); \ + } else if (!wasm_string_slices_are_equal(&(begin_label), \ + &(end_label))) { \ + wasm_ast_parser_error(&loc, lexer, parser, \ + "mismatching label \"" PRIstringslice \ + "\" != \"" PRIstringslice "\"", \ + WASM_PRINTF_STRING_SLICE_ARG(begin_label), \ + WASM_PRINTF_STRING_SLICE_ARG(end_label)); \ + } \ + wasm_destroy_string_slice(parser->allocator, &(end_label)); \ + } \ + } while (0) + #define YYMALLOC(size) wasm_alloc(parser->allocator, size, WASM_DEFAULT_ALIGN) #define YYFREE(p) wasm_free(parser->allocator, p) @@ -571,26 +590,31 @@ plain_instr : } ; block_instr : - BLOCK labeling_opt block END { + BLOCK labeling_opt block END labeling_opt { $$ = wasm_new_block_expr(parser->allocator); $$->block = $3; $$->block.label = $2; + CHECK_END_LABEL(@5, $$->block.label, $5); } - | LOOP labeling_opt block END { + | LOOP labeling_opt block END labeling_opt { $$ = wasm_new_loop_expr(parser->allocator); $$->loop = $3; $$->loop.label = $2; + CHECK_END_LABEL(@5, $$->block.label, $5); } - | IF labeling_opt block END { + | IF labeling_opt block END labeling_opt { $$ = wasm_new_if_expr(parser->allocator); $$->if_.true_ = $3; $$->if_.true_.label = $2; + CHECK_END_LABEL(@5, $$->block.label, $5); } - | IF labeling_opt block ELSE instr_list END { + | IF labeling_opt block ELSE labeling_opt instr_list END labeling_opt { $$ = wasm_new_if_expr(parser->allocator); $$->if_.true_ = $3; $$->if_.true_.label = $2; - $$->if_.false_ = $5.first; + $$->if_.false_ = $6.first; + CHECK_END_LABEL(@5, $$->block.label, $5); + CHECK_END_LABEL(@8, $$->block.label, $8); } ; block : diff --git a/src/binary-reader-interpreter.c b/src/binary-reader-interpreter.c index bfbb9cc5..66882aac 100644 --- a/src/binary-reader-interpreter.c +++ b/src/binary-reader-interpreter.c @@ -836,7 +836,7 @@ static WasmResult on_init_expr_get_global_expr(uint32_t index, void* user_data) { Context* ctx = user_data; WasmInterpreterGlobal* ref_global = - get_global_by_defined_index(ctx, global_index); + get_global_by_module_index(ctx, global_index); ctx->init_expr_value = ref_global->typed_value; return WASM_OK; } diff --git a/src/prebuilt/ast-parser-gen.c b/src/prebuilt/ast-parser-gen.c index 1ef5b1e3..c49768c5 100644 --- a/src/prebuilt/ast-parser-gen.c +++ b/src/prebuilt/ast-parser-gen.c @@ -166,6 +166,25 @@ } \ } while (0) +#define CHECK_END_LABEL(loc, begin_label, end_label) \ + do { \ + if (!wasm_string_slice_is_empty(&(end_label))) { \ + if (wasm_string_slice_is_empty(&(begin_label))) { \ + wasm_ast_parser_error(&loc, lexer, parser, \ + "unexpected label \"" PRIstringslice "\"", \ + WASM_PRINTF_STRING_SLICE_ARG(end_label)); \ + } else if (!wasm_string_slices_are_equal(&(begin_label), \ + &(end_label))) { \ + wasm_ast_parser_error(&loc, lexer, parser, \ + "mismatching label \"" PRIstringslice \ + "\" != \"" PRIstringslice "\"", \ + WASM_PRINTF_STRING_SLICE_ARG(begin_label), \ + WASM_PRINTF_STRING_SLICE_ARG(end_label)); \ + } \ + wasm_destroy_string_slice(parser->allocator, &(end_label)); \ + } \ + } while (0) + #define YYMALLOC(size) wasm_alloc(parser->allocator, size, WASM_DEFAULT_ALIGN) #define YYFREE(p) wasm_free(parser->allocator, p) @@ -222,7 +241,7 @@ static void on_read_binary_error(uint32_t offset, const char* error, #define wasm_ast_parser_lex wasm_ast_lexer_lex -#line 226 "src/prebuilt/ast-parser-gen.c" /* yacc.c:339 */ +#line 245 "src/prebuilt/ast-parser-gen.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -368,7 +387,7 @@ int wasm_ast_parser_parse (WasmAstLexer* lexer, WasmAstParser* parser); /* Copy the second part of user declarations. */ -#line 372 "src/prebuilt/ast-parser-gen.c" /* yacc.c:358 */ +#line 391 "src/prebuilt/ast-parser-gen.c" /* yacc.c:358 */ #ifdef short # undef short @@ -612,7 +631,7 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 10 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 758 +#define YYLAST 790 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 73 @@ -621,7 +640,7 @@ union yyalloc /* YYNRULES -- Number of rules. */ #define YYNRULES 170 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 393 +#define YYNSTATES 398 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ @@ -674,24 +693,24 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 279, 279, 285, 295, 296, 300, 318, 319, 325, - 328, 333, 340, 343, 344, 348, 353, 360, 363, 366, - 371, 378, 384, 395, 399, 403, 410, 415, 422, 423, - 429, 430, 433, 437, 438, 442, 443, 453, 454, 465, - 466, 467, 470, 473, 476, 479, 482, 486, 490, 495, - 498, 502, 506, 510, 514, 518, 522, 526, 532, 538, - 550, 554, 558, 562, 566, 569, 574, 579, 584, 589, - 597, 605, 609, 612, 618, 624, 633, 639, 644, 650, - 655, 661, 669, 670, 678, 679, 687, 692, 693, 699, - 705, 715, 721, 727, 737, 792, 801, 808, 815, 825, - 828, 832, 838, 849, 855, 875, 882, 894, 901, 922, - 945, 952, 965, 972, 978, 984, 990, 998, 1003, 1010, - 1016, 1022, 1028, 1037, 1045, 1050, 1055, 1060, 1067, 1074, - 1078, 1081, 1092, 1096, 1103, 1107, 1110, 1118, 1126, 1143, - 1159, 1170, 1177, 1184, 1190, 1230, 1240, 1262, 1272, 1298, - 1303, 1311, 1319, 1329, 1335, 1341, 1347, 1353, 1359, 1364, - 1373, 1378, 1379, 1385, 1394, 1395, 1403, 1415, 1416, 1423, - 1488 + 0, 298, 298, 304, 314, 315, 319, 337, 338, 344, + 347, 352, 359, 362, 363, 367, 372, 379, 382, 385, + 390, 397, 403, 414, 418, 422, 429, 434, 441, 442, + 448, 449, 452, 456, 457, 461, 462, 472, 473, 484, + 485, 486, 489, 492, 495, 498, 501, 505, 509, 514, + 517, 521, 525, 529, 533, 537, 541, 545, 551, 557, + 569, 573, 577, 581, 585, 588, 593, 599, 605, 611, + 621, 629, 633, 636, 642, 648, 657, 663, 668, 674, + 679, 685, 693, 694, 702, 703, 711, 716, 717, 723, + 729, 739, 745, 751, 761, 816, 825, 832, 839, 849, + 852, 856, 862, 873, 879, 899, 906, 918, 925, 946, + 969, 976, 989, 996, 1002, 1008, 1014, 1022, 1027, 1034, + 1040, 1046, 1052, 1061, 1069, 1074, 1079, 1084, 1091, 1098, + 1102, 1105, 1116, 1120, 1127, 1131, 1134, 1142, 1150, 1167, + 1183, 1194, 1201, 1208, 1214, 1254, 1264, 1286, 1296, 1322, + 1327, 1335, 1343, 1353, 1359, 1365, 1371, 1377, 1383, 1388, + 1397, 1402, 1403, 1409, 1418, 1419, 1427, 1439, 1440, 1447, + 1512 }; #endif @@ -757,46 +776,46 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - -276, 54, -276, 66, 69, -276, -276, -276, -276, -276, - -276, 62, 98, 119, 119, 140, 140, 140, 158, 158, - 166, -276, 200, -276, -276, 119, -276, 98, 98, 128, - 98, 98, 98, -16, -276, 196, -4, 98, 98, -276, - 188, 137, 215, -276, 217, 229, 237, 242, 155, -276, - 244, 252, -276, -276, 116, -276, -276, -276, -276, -276, - -276, -276, -276, -276, -276, -276, -276, 210, -276, -276, - -276, -276, 228, -276, -276, -276, -276, 62, 206, 84, - 62, 62, 107, 62, 107, 98, 98, -276, 230, 369, - -276, -276, -276, 263, 183, 264, 281, 57, 282, 290, - 292, -276, -276, 293, 292, 200, 98, 298, -276, -276, - -276, 302, 249, -276, -276, 62, 62, 62, 206, 206, - -276, 206, 206, -276, 206, 206, 206, 206, 206, 267, - 267, 230, -276, -276, -276, -276, -276, -276, -276, -276, - 402, 435, -276, -276, -276, -276, -276, -276, 311, 322, - 468, -276, 323, -276, 332, 23, -276, 435, 58, 58, - 192, 333, 146, -276, 62, 62, 62, 435, 334, 337, - -276, 75, 171, 333, 333, 339, 200, 335, 340, 342, - 93, 343, -276, 206, 62, -276, 62, 98, 98, -276, - -276, -276, -276, -276, -276, 206, -276, -276, -276, -276, - -276, -276, -276, -276, 304, 304, -276, 573, 348, 713, - -276, -276, 190, 350, 351, 534, 402, 357, 205, 367, - -276, 375, -276, 383, 376, 390, 435, 400, 407, 333, - -276, 417, 423, -276, -276, -276, 433, 334, -276, -276, - 173, -276, -276, 200, 447, -276, 449, 364, 450, -276, - 96, 456, 206, 206, 206, 206, -276, 466, 97, 474, - 117, 150, 476, 98, 483, 336, 477, 104, 487, 211, - -276, -276, -276, -276, -276, -276, -276, -276, 513, -276, - -276, 515, -276, -276, 516, -276, -276, -276, 471, -276, - -276, 71, -276, -276, -276, -276, 532, -276, -276, 200, - -276, 62, 62, 62, 62, -276, 533, 546, 548, 549, - -276, 402, -276, 555, 501, 501, 565, 566, -276, -276, - -276, -276, 435, -276, 170, 189, -276, -276, -276, -276, - 647, 577, -276, 585, 587, 322, 58, 333, 333, -276, - -276, -276, -276, -276, 402, 612, -276, -276, 501, -276, - 576, 578, -276, 201, 435, 680, 334, -276, 594, 604, - 605, 615, 616, 617, -276, -276, -276, 580, 624, 627, - 435, -276, -276, -276, -276, -276, -276, -276, -276, -276, - 634, 643, 191, 629, 655, -276, 435, 640, 662, 435, - -276, 668, -276 + -276, 33, -276, 76, 58, -276, -276, -276, -276, -276, + -276, 72, 154, 97, 97, 176, 176, 176, 185, 185, + 187, -276, 208, -276, -276, 97, -276, 154, 154, 140, + 154, 154, 154, 143, -276, 191, 12, 154, 154, -276, + 139, 227, 218, -276, 220, 228, 242, 243, 231, -276, + 245, 247, -276, -276, 98, -276, -276, -276, -276, -276, + -276, -276, -276, -276, -276, -276, -276, 237, -276, -276, + -276, -276, 215, -276, -276, -276, -276, 72, 212, 43, + 72, 72, 99, 72, 99, 154, 154, -276, 109, 401, + -276, -276, -276, 249, 209, 252, 255, 48, 256, 322, + 267, -276, -276, 268, 267, 208, 154, 270, -276, -276, + -276, 271, 281, -276, -276, 72, 72, 72, 212, 212, + -276, 212, 212, -276, 212, 212, 212, 212, 212, 239, + 239, 109, -276, -276, -276, -276, -276, -276, -276, -276, + 434, 467, -276, -276, -276, -276, -276, -276, 272, 274, + 500, -276, 276, -276, 277, 20, -276, 467, 61, 61, + 183, 275, 83, -276, 72, 72, 72, 467, 279, 280, + -276, 125, 104, 275, 275, 282, 208, 278, 283, 285, + 113, 293, -276, 212, 72, -276, 72, 154, 154, -276, + -276, -276, -276, -276, -276, 212, -276, -276, -276, -276, + -276, -276, -276, -276, 253, 253, -276, 605, 295, 745, + -276, -276, 179, 296, 302, 566, 434, 312, 195, 313, + -276, 273, -276, 323, 316, 329, 467, 330, 327, 275, + -276, 344, 353, -276, -276, -276, 354, 279, -276, -276, + 167, -276, -276, 208, 364, -276, 365, 315, 366, -276, + 114, 369, 212, 212, 212, 212, -276, 370, 95, 367, + 103, 127, 374, 154, 371, 368, 360, 132, 363, 214, + -276, -276, -276, -276, -276, -276, -276, -276, 382, -276, + -276, 383, -276, -276, 389, -276, -276, -276, 348, -276, + -276, 74, -276, -276, -276, -276, 413, -276, -276, 208, + -276, 72, 72, 72, 72, -276, 415, 416, 422, 432, + -276, 434, -276, 446, 533, 533, 448, 449, -276, -276, + 72, 72, 72, 72, 170, 177, -276, -276, -276, -276, + 679, 456, -276, 465, 479, 274, 61, 275, 275, -276, + -276, -276, -276, -276, 434, 644, -276, -276, 533, -276, + -276, -276, 467, -276, 482, -276, 198, 467, 712, 279, + -276, 488, 498, 512, 514, 515, 521, -276, -276, 470, + 485, 545, 547, 467, -276, -276, -276, -276, -276, -276, + -276, 72, -276, -276, 549, 554, -276, 188, 550, 565, + -276, 467, 563, 580, 467, -276, 581, -276 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -836,33 +855,33 @@ static const yytype_uint8 yydefact[] = 73, 0, 74, 99, 85, 101, 0, 121, 107, 4, 105, 30, 30, 30, 30, 117, 0, 0, 0, 0, 21, 82, 8, 0, 82, 82, 0, 0, 131, 70, - 66, 68, 82, 67, 0, 0, 95, 11, 110, 28, + 33, 33, 33, 33, 0, 0, 95, 11, 110, 28, 0, 0, 75, 0, 0, 13, 0, 0, 0, 124, 127, 125, 126, 89, 82, 0, 88, 92, 82, 123, - 0, 14, 16, 0, 82, 0, 81, 109, 0, 0, - 0, 0, 0, 0, 90, 93, 69, 0, 0, 0, - 82, 80, 108, 113, 112, 116, 114, 115, 7, 104, - 77, 0, 0, 0, 79, 15, 82, 0, 0, 82, - 76, 0, 78 + 66, 68, 82, 67, 14, 16, 0, 82, 0, 81, + 109, 0, 0, 0, 0, 0, 0, 90, 93, 0, + 0, 0, 0, 82, 80, 108, 113, 112, 116, 114, + 115, 33, 7, 104, 77, 0, 69, 0, 0, 79, + 15, 82, 0, 0, 82, 76, 0, 78 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -276, 660, -143, -21, -161, 455, -139, 600, -148, -154, - -159, -147, -137, -111, 568, -30, -117, -43, -40, -61, - 575, 510, -276, -98, -276, -163, -82, -276, -276, -136, - 479, -124, -275, -270, -108, -276, 15, -276, -276, -276, - -276, -276, -276, -276, 87, -276, -276, 626, 91, -276, - -276, -276, 187, -276, 16, 225, -276, -276, -276, -276, - 688, -276, -276 + -276, 569, -150, -3, -174, 373, -142, 506, -139, -148, + -156, -152, -144, -112, 481, 14, -111, -39, -11, -109, + 483, 418, -276, -97, -276, -138, -81, -276, -276, -137, + 384, -136, -266, -275, -107, -276, -37, -276, -276, -276, + -276, -276, -276, -276, -12, -276, -276, 527, 80, -276, + -276, -276, 184, -276, 23, 219, -276, -276, -276, -276, + 597, -276, -276 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 177, 178, 25, 265, 231, 157, 95, 213, 227, - 244, 228, 140, 92, 111, 242, 171, 22, 23, 190, + 244, 228, 140, 92, 111, 242, 171, 22, 189, 190, 204, 271, 141, 142, 143, 266, 144, 169, 332, 145, 238, 223, 146, 147, 148, 56, 102, 57, 58, 59, 60, 61, 251, 62, 149, 181, 63, 162, 150, 64, @@ -875,162 +894,170 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 101, 168, 101, 195, 219, 210, 43, 44, 232, 45, - 46, 47, 214, 216, 168, 246, 50, 51, 101, 225, - 226, 222, 101, 258, 260, 261, 245, 245, 267, 268, - 28, 222, 208, 248, 89, 221, 343, 97, 98, 96, - 103, 42, 217, 236, 346, 347, 13, 14, 93, 11, - 229, 229, 100, 240, 104, 191, 192, 4, 13, 14, - 155, 224, 229, 229, 106, 107, 10, 156, 156, 364, - 290, 21, 292, 291, 330, 189, 189, 189, 365, 241, - 90, 312, 187, 188, 91, 179, 237, 94, 193, 194, - 222, 196, 197, 21, 198, 199, 200, 201, 202, 105, - 296, 311, 284, 233, 234, 235, 24, 312, 278, 168, - 99, 168, 90, 324, 325, 170, 91, 168, 287, 176, - 321, 314, 11, 322, 189, 189, 189, 312, 26, 319, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 252, - 54, 55, 301, 29, 259, 253, 262, 254, 302, 255, - 303, 90, 304, 257, 315, 237, 334, 230, 72, 73, - 312, 33, 77, 78, 79, 269, 263, 264, 80, 36, - 81, 82, 83, 84, 351, 85, 86, 295, 90, 363, - 312, 11, 91, 362, 158, 161, 350, 359, 159, 163, - 173, 245, 52, 352, 175, 385, 53, 361, 360, 312, - 49, 312, 30, 31, 32, 368, 90, 37, 39, 331, - 91, 90, 353, 72, 87, 91, -29, 382, 369, 66, - -29, 68, 306, 307, 308, 309, 229, 229, 243, 152, - 187, 188, 168, 69, 381, 108, 109, 110, 183, 274, - 275, 70, 317, 34, 35, 38, 71, 168, 75, 356, - 388, 187, 188, 391, 274, 275, 76, 168, 335, 336, - 337, 338, 113, 114, 164, 88, 165, 151, 153, 166, - 118, 119, 120, 121, 371, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 94, 160, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 99, 172, 183, 184, 185, - 186, 180, 203, 113, 114, 164, 182, 165, 187, 188, - 166, 118, 119, 120, 121, 211, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 212, 218, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 220, 209, 90, 209, - 270, 239, 247, 53, 249, 250, 312, 256, 167, 113, - 114, 115, 273, 116, 276, 277, 117, 118, 119, 120, - 121, 279, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 280, 112, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 113, 114, 115, 281, 116, 282, 221, 117, - 118, 119, 120, 121, 283, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 285, 207, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 113, 114, 115, 230, 116, - 288, 299, 117, 118, 119, 120, 121, 289, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 293, 209, 131, + 23, 101, 168, 101, 210, 214, 216, 191, 192, 195, + 258, 260, 261, 219, 232, 168, 225, 226, 246, 101, + 222, 245, 245, 101, 43, 44, 248, 45, 46, 47, + 222, 236, 221, 208, 50, 51, 4, 28, 89, 346, + 347, 97, 98, 217, 103, 343, 94, 105, 42, 229, + 229, 155, 21, 267, 268, 233, 234, 235, 156, 240, + 291, 229, 229, 170, 224, 11, 23, 176, 96, 23, + 23, 156, 23, 368, 13, 14, 10, 330, 367, 187, + 188, 21, 106, 107, 312, 158, 161, 237, 90, 222, + 284, 173, 93, 296, 230, 290, 100, 292, 104, 311, + 324, 325, 99, 179, 90, 312, 26, 314, 91, 278, + 168, 11, 168, 312, 108, 109, 110, 287, 168, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 319, 241, + 90, 315, 193, 194, 91, 196, 197, 312, 198, 199, + 200, 201, 202, 52, 77, 78, 79, 53, 321, 334, + 80, 322, 81, 82, 83, 84, 237, 85, 86, 252, + 301, 243, 24, 187, 188, 253, 302, 254, 303, 255, + 304, 295, 90, 259, 354, 262, 91, 159, 163, 29, + 312, 355, 366, 175, 263, 264, 245, 312, 33, 365, + 36, 363, 390, 11, 364, 49, 362, 257, 312, 30, + 31, 32, 371, 90, 37, 13, 14, 91, 387, 269, + 331, 350, 351, 352, 353, 369, 39, 90, 356, -29, + 372, 91, 66, -29, 68, 229, 229, 183, 274, 275, + 54, 55, 69, 168, 72, 73, 385, 34, 35, 38, + 72, 87, 187, 188, 274, 275, 70, 71, 168, 75, + 359, 76, 88, 151, 393, 152, 153, 396, 94, 160, + 317, 168, 335, 336, 337, 338, 306, 307, 308, 309, + 99, 172, 386, 180, 203, 182, 211, 212, 374, 218, + 90, 220, 209, 281, 239, 247, 53, 249, 250, 270, + 23, 23, 23, 23, 113, 114, 164, 256, 165, 273, + 276, 166, 118, 119, 120, 121, 277, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 279, 280, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 282, 221, 183, + 184, 185, 186, 283, 285, 113, 114, 164, 230, 165, + 187, 188, 166, 118, 119, 120, 121, 288, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 289, 293, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 297, 298, + 300, 209, 299, 305, 310, 318, 320, 313, 312, 323, + 167, 113, 114, 115, 316, 116, 326, 327, 117, 118, + 119, 120, 121, 328, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 329, 112, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 113, 114, 115, 333, 116, 339, + 340, 117, 118, 119, 120, 121, 341, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 342, 207, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 113, 114, 115, + 344, 116, 348, 349, 117, 118, 119, 120, 121, 358, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 360, + 209, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 113, 114, 115, 361, 116, 370, 381, 117, 118, 119, + 120, 121, 375, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 376, 215, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 113, 114, 115, 377, 116, 378, 379, + 117, 118, 119, 120, 121, 380, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 382, 345, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 113, 114, 115, 383, + 116, 384, 388, 117, 118, 119, 120, 121, 389, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 392, 391, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 113, + 114, 164, 394, 165, 395, 397, 166, 118, 119, 120, + 121, 40, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 286, 154, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 206, 205, 183, 184, 185, 186, 113, 114, + 164, 294, 165, 272, 0, 166, 118, 119, 120, 121, + 174, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 67, 0, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 0, 0, 0, 184, 185, 186, 113, 114, 164, + 0, 165, 0, 0, 166, 118, 119, 120, 121, 0, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 0, + 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 0, 0, 113, 114, 164, 186, 165, 357, 0, 166, + 118, 119, 120, 121, 0, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 0, 0, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 113, 114, 164, 0, 165, + 373, 0, 166, 118, 119, 120, 121, 0, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, 139, 113, 114, - 115, 297, 116, 298, 300, 117, 118, 119, 120, 121, - 305, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 310, 215, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 113, 114, 115, 313, 116, 316, 318, 117, 118, - 119, 120, 121, 320, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 323, 345, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 113, 114, 115, 326, 116, 327, - 328, 117, 118, 119, 120, 121, 329, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 333, 339, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 113, 114, 164, - 340, 165, 341, 342, 166, 118, 119, 120, 121, 344, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 348, - 349, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 355, 367, 183, 184, 185, 186, 113, 114, 164, 357, - 165, 358, 366, 166, 118, 119, 120, 121, 372, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 373, 374, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 375, - 376, 377, 184, 185, 186, 113, 114, 164, 379, 165, - 378, 380, 166, 118, 119, 120, 121, 383, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 384, 386, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 387, 389, - 113, 114, 164, 186, 165, 354, 390, 166, 118, 119, - 120, 121, 392, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 40, 286, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 113, 114, 164, 154, 165, 370, 206, - 166, 118, 119, 120, 121, 205, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 272, 294, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 113, 114, 164, 174, - 165, 67, 0, 166, 118, 119, 120, 121, 0, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 0, 0, - 131, 132, 133, 134, 135, 136, 137, 138, 139 + 164, 0, 165, 0, 0, 166, 118, 119, 120, 121, + 0, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 0, 0, 131, 132, 133, 134, 135, 136, 137, 138, + 139 }; static const yytype_int16 yycheck[] = { - 82, 99, 84, 120, 152, 141, 27, 28, 162, 30, - 31, 32, 149, 150, 112, 174, 37, 38, 100, 158, - 159, 157, 104, 184, 185, 186, 173, 174, 191, 192, - 14, 167, 140, 176, 77, 12, 311, 80, 81, 79, - 83, 25, 150, 167, 314, 315, 62, 63, 78, 53, - 161, 162, 82, 170, 84, 116, 117, 3, 62, 63, - 3, 3, 173, 174, 85, 86, 0, 10, 10, 344, - 233, 9, 235, 234, 3, 115, 116, 117, 348, 4, - 5, 10, 59, 60, 9, 106, 168, 3, 118, 119, - 226, 121, 122, 9, 124, 125, 126, 127, 128, 84, - 243, 4, 226, 164, 165, 166, 8, 10, 216, 207, - 3, 209, 5, 274, 275, 100, 9, 215, 229, 104, - 16, 4, 53, 19, 164, 165, 166, 10, 9, 265, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 46, - 3, 4, 46, 3, 184, 52, 186, 54, 52, 56, - 54, 5, 56, 183, 4, 237, 299, 11, 3, 4, - 10, 3, 46, 47, 48, 195, 187, 188, 52, 3, - 54, 55, 56, 57, 4, 59, 60, 4, 5, 338, - 10, 53, 9, 337, 97, 98, 322, 335, 97, 98, - 103, 338, 4, 4, 103, 4, 8, 336, 335, 10, - 4, 10, 15, 16, 17, 4, 5, 20, 8, 291, - 9, 5, 329, 3, 4, 9, 5, 378, 354, 4, - 9, 4, 252, 253, 254, 255, 337, 338, 57, 46, - 59, 60, 330, 4, 370, 5, 6, 7, 48, 49, - 50, 4, 263, 18, 19, 20, 4, 345, 4, 331, - 386, 59, 60, 389, 49, 50, 4, 355, 301, 302, - 303, 304, 13, 14, 15, 37, 17, 4, 4, 20, - 21, 22, 23, 24, 356, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 3, 3, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 3, 3, 48, 49, 50, - 51, 3, 35, 13, 14, 15, 4, 17, 59, 60, - 20, 21, 22, 23, 24, 4, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 3, 3, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 4, 3, 5, 3, - 36, 4, 3, 8, 4, 3, 10, 4, 58, 13, - 14, 15, 4, 17, 4, 4, 20, 21, 22, 23, - 24, 4, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 4, 3, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 13, 14, 15, 10, 17, 4, 12, 20, - 21, 22, 23, 24, 4, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 4, 3, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 13, 14, 15, 11, 17, - 3, 57, 20, 21, 22, 23, 24, 4, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 4, 3, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 13, 14, - 15, 4, 17, 4, 4, 20, 21, 22, 23, 24, - 4, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 4, 3, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 13, 14, 15, 10, 17, 10, 4, 20, 21, - 22, 23, 24, 16, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 16, 3, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 13, 14, 15, 4, 17, 4, - 4, 20, 21, 22, 23, 24, 55, 26, 27, 28, + 11, 82, 99, 84, 141, 149, 150, 116, 117, 120, + 184, 185, 186, 152, 162, 112, 158, 159, 174, 100, + 157, 173, 174, 104, 27, 28, 176, 30, 31, 32, + 167, 167, 12, 140, 37, 38, 3, 14, 77, 314, + 315, 80, 81, 150, 83, 311, 3, 84, 25, 161, + 162, 3, 9, 191, 192, 164, 165, 166, 10, 170, + 234, 173, 174, 100, 3, 53, 77, 104, 79, 80, + 81, 10, 83, 348, 62, 63, 0, 3, 344, 59, + 60, 9, 85, 86, 10, 97, 98, 168, 5, 226, + 226, 103, 78, 243, 11, 233, 82, 235, 84, 4, + 274, 275, 3, 106, 5, 10, 9, 4, 9, 216, + 207, 53, 209, 10, 5, 6, 7, 229, 215, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 265, 4, + 5, 4, 118, 119, 9, 121, 122, 10, 124, 125, + 126, 127, 128, 4, 46, 47, 48, 8, 16, 299, + 52, 19, 54, 55, 56, 57, 237, 59, 60, 46, + 46, 57, 8, 59, 60, 52, 52, 54, 54, 56, + 56, 4, 5, 184, 4, 186, 9, 97, 98, 3, + 10, 4, 338, 103, 187, 188, 338, 10, 3, 337, + 3, 335, 4, 53, 336, 4, 335, 183, 10, 15, + 16, 17, 4, 5, 20, 62, 63, 9, 382, 195, + 291, 320, 321, 322, 323, 352, 8, 5, 329, 5, + 357, 9, 4, 9, 4, 337, 338, 48, 49, 50, + 3, 4, 4, 330, 3, 4, 373, 18, 19, 20, + 3, 4, 59, 60, 49, 50, 4, 4, 345, 4, + 331, 4, 37, 4, 391, 46, 4, 394, 3, 3, + 263, 358, 301, 302, 303, 304, 252, 253, 254, 255, + 3, 3, 381, 3, 35, 4, 4, 3, 359, 3, + 5, 4, 3, 10, 4, 3, 8, 4, 3, 36, + 301, 302, 303, 304, 13, 14, 15, 4, 17, 4, + 4, 20, 21, 22, 23, 24, 4, 26, 27, 28, 29, 30, 31, 32, 33, 34, 4, 4, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 4, 12, 48, + 49, 50, 51, 4, 4, 13, 14, 15, 11, 17, + 59, 60, 20, 21, 22, 23, 24, 3, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 4, 4, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 4, 4, + 4, 3, 57, 4, 4, 4, 16, 10, 10, 16, + 58, 13, 14, 15, 10, 17, 4, 4, 20, 21, + 22, 23, 24, 4, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 55, 3, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 13, 14, 15, 4, 17, 4, + 4, 20, 21, 22, 23, 24, 4, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 4, 3, 37, 38, 39, 40, 41, 42, 43, 44, 45, 13, 14, 15, - 4, 17, 4, 4, 20, 21, 22, 23, 24, 4, + 4, 17, 4, 4, 20, 21, 22, 23, 24, 3, 26, 27, 28, 29, 30, 31, 32, 33, 34, 4, - 4, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 3, 3, 48, 49, 50, 51, 13, 14, 15, 4, - 17, 4, 16, 20, 21, 22, 23, 24, 4, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 4, 4, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 4, - 4, 4, 49, 50, 51, 13, 14, 15, 4, 17, - 50, 4, 20, 21, 22, 23, 24, 3, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 4, 19, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 3, 19, - 13, 14, 15, 51, 17, 18, 4, 20, 21, 22, + 3, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 13, 14, 15, 4, 17, 3, 16, 20, 21, 22, 23, 24, 4, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 22, 228, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 13, 14, 15, 96, 17, 18, 131, - 20, 21, 22, 23, 24, 130, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 205, 237, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 13, 14, 15, 103, - 17, 43, -1, 20, 21, 22, 23, 24, -1, 26, - 27, 28, 29, 30, 31, 32, 33, 34, -1, -1, - 37, 38, 39, 40, 41, 42, 43, 44, 45 + 33, 34, 4, 3, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 13, 14, 15, 4, 17, 4, 4, + 20, 21, 22, 23, 24, 4, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 50, 3, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 13, 14, 15, 4, + 17, 4, 3, 20, 21, 22, 23, 24, 4, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 3, 19, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 13, + 14, 15, 19, 17, 4, 4, 20, 21, 22, 23, + 24, 22, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 228, 96, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 131, 130, 48, 49, 50, 51, 13, 14, + 15, 237, 17, 205, -1, 20, 21, 22, 23, 24, + 103, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 43, -1, 37, 38, 39, 40, 41, 42, 43, 44, + 45, -1, -1, -1, 49, 50, 51, 13, 14, 15, + -1, 17, -1, -1, 20, 21, 22, 23, 24, -1, + 26, 27, 28, 29, 30, 31, 32, 33, 34, -1, + -1, 37, 38, 39, 40, 41, 42, 43, 44, 45, + -1, -1, 13, 14, 15, 51, 17, 18, -1, 20, + 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, + 31, 32, 33, 34, -1, -1, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 13, 14, 15, -1, 17, + 18, -1, 20, 21, 22, 23, 24, -1, 26, 27, + 28, 29, 30, 31, 32, 33, 34, -1, -1, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 13, 14, + 15, -1, 17, -1, -1, 20, 21, 22, 23, 24, + -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, + -1, -1, 37, 38, 39, 40, 41, 42, 43, 44, + 45 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1072,11 +1099,11 @@ static const yytype_uint8 yystos[] = 16, 16, 19, 16, 77, 77, 4, 4, 4, 55, 3, 99, 101, 4, 75, 90, 90, 90, 90, 4, 4, 4, 4, 105, 4, 3, 106, 106, 4, 4, - 102, 4, 4, 89, 18, 3, 99, 4, 4, 81, - 85, 79, 82, 83, 105, 106, 16, 3, 4, 102, - 18, 99, 4, 4, 4, 4, 4, 4, 50, 4, - 4, 102, 77, 3, 4, 4, 19, 3, 102, 19, - 4, 102, 4 + 92, 92, 92, 92, 4, 4, 89, 18, 3, 99, + 4, 4, 81, 85, 79, 82, 83, 105, 106, 102, + 3, 4, 102, 18, 99, 4, 4, 4, 4, 4, + 4, 16, 50, 4, 4, 102, 92, 77, 3, 4, + 4, 19, 3, 102, 19, 4, 102, 4 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -1111,7 +1138,7 @@ static const yytype_uint8 yyr2[] = 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, - 1, 1, 1, 1, 1, 1, 4, 4, 4, 6, + 1, 1, 1, 1, 1, 1, 5, 5, 5, 8, 2, 3, 2, 3, 3, 4, 8, 4, 9, 5, 3, 2, 0, 2, 0, 2, 1, 1, 5, 5, 6, 1, 5, 6, 1, 7, 6, 6, 5, 4, @@ -1619,333 +1646,333 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio switch (yytype) { case 5: /* NAT */ -#line 240 "src/ast-parser.y" /* yacc.c:1257 */ +#line 259 "src/ast-parser.y" /* yacc.c:1257 */ {} -#line 1625 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1652 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 6: /* INT */ -#line 240 "src/ast-parser.y" /* yacc.c:1257 */ +#line 259 "src/ast-parser.y" /* yacc.c:1257 */ {} -#line 1631 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1658 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 7: /* FLOAT */ -#line 240 "src/ast-parser.y" /* yacc.c:1257 */ +#line 259 "src/ast-parser.y" /* yacc.c:1257 */ {} -#line 1637 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1664 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 8: /* TEXT */ -#line 240 "src/ast-parser.y" /* yacc.c:1257 */ +#line 259 "src/ast-parser.y" /* yacc.c:1257 */ {} -#line 1643 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1670 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 9: /* VAR */ -#line 240 "src/ast-parser.y" /* yacc.c:1257 */ +#line 259 "src/ast-parser.y" /* yacc.c:1257 */ {} -#line 1649 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1676 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 35: /* OFFSET_EQ_NAT */ -#line 240 "src/ast-parser.y" /* yacc.c:1257 */ +#line 259 "src/ast-parser.y" /* yacc.c:1257 */ {} -#line 1655 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1682 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 36: /* ALIGN_EQ_NAT */ -#line 240 "src/ast-parser.y" /* yacc.c:1257 */ +#line 259 "src/ast-parser.y" /* yacc.c:1257 */ {} -#line 1661 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1688 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 74: /* non_empty_text_list */ -#line 263 "src/ast-parser.y" /* yacc.c:1257 */ +#line 282 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_text_list(parser->allocator, &((*yyvaluep).text_list)); } -#line 1667 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1694 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 75: /* text_list */ -#line 263 "src/ast-parser.y" /* yacc.c:1257 */ +#line 282 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_text_list(parser->allocator, &((*yyvaluep).text_list)); } -#line 1673 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1700 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 76: /* quoted_text */ -#line 262 "src/ast-parser.y" /* yacc.c:1257 */ +#line 281 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_string_slice(parser->allocator, &((*yyvaluep).text)); } -#line 1679 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1706 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 77: /* value_type_list */ -#line 264 "src/ast-parser.y" /* yacc.c:1257 */ +#line 283 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_type_vector(parser->allocator, &((*yyvaluep).types)); } -#line 1685 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1712 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 80: /* func_type */ -#line 254 "src/ast-parser.y" /* yacc.c:1257 */ +#line 273 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_func_signature(parser->allocator, &((*yyvaluep).func_sig)); } -#line 1691 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1718 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 81: /* func_sig */ -#line 254 "src/ast-parser.y" /* yacc.c:1257 */ +#line 273 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_func_signature(parser->allocator, &((*yyvaluep).func_sig)); } -#line 1697 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1724 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 85: /* type_use */ -#line 266 "src/ast-parser.y" /* yacc.c:1257 */ +#line 285 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_var(parser->allocator, &((*yyvaluep).var)); } -#line 1703 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1730 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 87: /* literal */ -#line 260 "src/ast-parser.y" /* yacc.c:1257 */ +#line 279 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_string_slice(parser->allocator, &((*yyvaluep).literal).text); } -#line 1709 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1736 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 88: /* var */ -#line 266 "src/ast-parser.y" /* yacc.c:1257 */ +#line 285 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_var(parser->allocator, &((*yyvaluep).var)); } -#line 1715 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1742 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 89: /* var_list */ -#line 265 "src/ast-parser.y" /* yacc.c:1257 */ +#line 284 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_var_vector_and_elements(parser->allocator, &((*yyvaluep).vars)); } -#line 1721 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1748 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 90: /* bind_var_opt */ -#line 262 "src/ast-parser.y" /* yacc.c:1257 */ +#line 281 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_string_slice(parser->allocator, &((*yyvaluep).text)); } -#line 1727 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1754 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 91: /* bind_var */ -#line 262 "src/ast-parser.y" /* yacc.c:1257 */ +#line 281 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_string_slice(parser->allocator, &((*yyvaluep).text)); } -#line 1733 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1760 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 92: /* labeling_opt */ -#line 262 "src/ast-parser.y" /* yacc.c:1257 */ +#line 281 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_string_slice(parser->allocator, &((*yyvaluep).text)); } -#line 1739 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1766 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 95: /* instr */ -#line 251 "src/ast-parser.y" /* yacc.c:1257 */ +#line 270 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_expr_list(parser->allocator, ((*yyvaluep).expr_list).first); } -#line 1745 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1772 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 96: /* plain_instr */ -#line 250 "src/ast-parser.y" /* yacc.c:1257 */ +#line 269 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_expr(parser->allocator, ((*yyvaluep).expr)); } -#line 1751 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1778 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 97: /* block_instr */ -#line 250 "src/ast-parser.y" /* yacc.c:1257 */ +#line 269 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_expr(parser->allocator, ((*yyvaluep).expr)); } -#line 1757 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1784 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 98: /* block */ -#line 241 "src/ast-parser.y" /* yacc.c:1257 */ +#line 260 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_block(parser->allocator, &((*yyvaluep).block)); } -#line 1763 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1790 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 99: /* expr */ -#line 251 "src/ast-parser.y" /* yacc.c:1257 */ +#line 270 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_expr_list(parser->allocator, ((*yyvaluep).expr_list).first); } -#line 1769 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1796 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 100: /* expr1 */ -#line 251 "src/ast-parser.y" /* yacc.c:1257 */ +#line 270 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_expr_list(parser->allocator, ((*yyvaluep).expr_list).first); } -#line 1775 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1802 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 101: /* if_ */ -#line 251 "src/ast-parser.y" /* yacc.c:1257 */ +#line 270 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_expr_list(parser->allocator, ((*yyvaluep).expr_list).first); } -#line 1781 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1808 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 102: /* instr_list */ -#line 251 "src/ast-parser.y" /* yacc.c:1257 */ +#line 270 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_expr_list(parser->allocator, ((*yyvaluep).expr_list).first); } -#line 1787 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1814 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 103: /* expr_list */ -#line 251 "src/ast-parser.y" /* yacc.c:1257 */ +#line 270 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_expr_list(parser->allocator, ((*yyvaluep).expr_list).first); } -#line 1793 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1820 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 104: /* const_expr */ -#line 251 "src/ast-parser.y" /* yacc.c:1257 */ +#line 270 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_expr_list(parser->allocator, ((*yyvaluep).expr_list).first); } -#line 1799 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1826 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 105: /* func_fields */ -#line 252 "src/ast-parser.y" /* yacc.c:1257 */ +#line 271 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_func_fields(parser->allocator, ((*yyvaluep).func_fields)); } -#line 1805 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1832 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 106: /* func_body */ -#line 252 "src/ast-parser.y" /* yacc.c:1257 */ +#line 271 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_func_fields(parser->allocator, ((*yyvaluep).func_fields)); } -#line 1811 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1838 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 107: /* func_info */ -#line 253 "src/ast-parser.y" /* yacc.c:1257 */ +#line 272 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_func(parser->allocator, ((*yyvaluep).func)); wasm_free(parser->allocator, ((*yyvaluep).func)); } -#line 1817 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1844 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 108: /* func */ -#line 247 "src/ast-parser.y" /* yacc.c:1257 */ +#line 266 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_exported_func(parser->allocator, &((*yyvaluep).exported_func)); } -#line 1823 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1850 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 109: /* offset */ -#line 251 "src/ast-parser.y" /* yacc.c:1257 */ +#line 270 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_expr_list(parser->allocator, ((*yyvaluep).expr_list).first); } -#line 1829 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1856 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 110: /* elem */ -#line 245 "src/ast-parser.y" /* yacc.c:1257 */ +#line 264 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_elem_segment(parser->allocator, &((*yyvaluep).elem_segment)); } -#line 1835 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1862 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 111: /* table */ -#line 249 "src/ast-parser.y" /* yacc.c:1257 */ +#line 268 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_exported_table(parser->allocator, &((*yyvaluep).exported_table)); } -#line 1841 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1868 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 112: /* data */ -#line 257 "src/ast-parser.y" /* yacc.c:1257 */ +#line 276 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_data_segment(parser->allocator, &((*yyvaluep).data_segment)); } -#line 1847 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1874 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 113: /* memory */ -#line 248 "src/ast-parser.y" /* yacc.c:1257 */ +#line 267 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_exported_memory(parser->allocator, &((*yyvaluep).exported_memory)); } -#line 1853 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1880 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 115: /* import_kind */ -#line 256 "src/ast-parser.y" /* yacc.c:1257 */ +#line 275 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_import(parser->allocator, ((*yyvaluep).import)); wasm_free(parser->allocator, ((*yyvaluep).import)); } -#line 1859 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1886 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 116: /* import */ -#line 256 "src/ast-parser.y" /* yacc.c:1257 */ +#line 275 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_import(parser->allocator, ((*yyvaluep).import)); wasm_free(parser->allocator, ((*yyvaluep).import)); } -#line 1865 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1892 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 117: /* inline_import */ -#line 256 "src/ast-parser.y" /* yacc.c:1257 */ +#line 275 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_import(parser->allocator, ((*yyvaluep).import)); wasm_free(parser->allocator, ((*yyvaluep).import)); } -#line 1871 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1898 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 118: /* export_kind */ -#line 246 "src/ast-parser.y" /* yacc.c:1257 */ +#line 265 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_export(parser->allocator, &((*yyvaluep).export_)); } -#line 1877 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1904 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 119: /* export */ -#line 246 "src/ast-parser.y" /* yacc.c:1257 */ +#line 265 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_export(parser->allocator, &((*yyvaluep).export_)); } -#line 1883 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1910 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 122: /* type_def */ -#line 255 "src/ast-parser.y" /* yacc.c:1257 */ +#line 274 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_func_type(parser->allocator, &((*yyvaluep).func_type)); } -#line 1889 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1916 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 123: /* start */ -#line 266 "src/ast-parser.y" /* yacc.c:1257 */ +#line 285 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_var(parser->allocator, &((*yyvaluep).var)); } -#line 1895 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1922 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 124: /* module_fields */ -#line 258 "src/ast-parser.y" /* yacc.c:1257 */ +#line 277 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_module(parser->allocator, ((*yyvaluep).module)); wasm_free(parser->allocator, ((*yyvaluep).module)); } -#line 1901 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1928 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 125: /* raw_module */ -#line 259 "src/ast-parser.y" /* yacc.c:1257 */ +#line 278 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_raw_module(parser->allocator, &((*yyvaluep).raw_module)); } -#line 1907 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1934 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 126: /* module */ -#line 258 "src/ast-parser.y" /* yacc.c:1257 */ +#line 277 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_module(parser->allocator, ((*yyvaluep).module)); wasm_free(parser->allocator, ((*yyvaluep).module)); } -#line 1913 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1940 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 127: /* script_var_opt */ -#line 266 "src/ast-parser.y" /* yacc.c:1257 */ +#line 285 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_var(parser->allocator, &((*yyvaluep).var)); } -#line 1919 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1946 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 129: /* assertion */ -#line 242 "src/ast-parser.y" /* yacc.c:1257 */ +#line 261 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_command(parser->allocator, ((*yyvaluep).command)); wasm_free(parser->allocator, ((*yyvaluep).command)); } -#line 1925 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1952 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 130: /* cmd */ -#line 242 "src/ast-parser.y" /* yacc.c:1257 */ +#line 261 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_command(parser->allocator, ((*yyvaluep).command)); wasm_free(parser->allocator, ((*yyvaluep).command)); } -#line 1931 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1958 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 131: /* cmd_list */ -#line 243 "src/ast-parser.y" /* yacc.c:1257 */ +#line 262 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_command_vector_and_elements(parser->allocator, &((*yyvaluep).commands)); } -#line 1937 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1964 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 133: /* const_list */ -#line 244 "src/ast-parser.y" /* yacc.c:1257 */ +#line 263 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_const_vector(parser->allocator, &((*yyvaluep).consts)); } -#line 1943 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1970 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; case 134: /* script */ -#line 261 "src/ast-parser.y" /* yacc.c:1257 */ +#line 280 "src/ast-parser.y" /* yacc.c:1257 */ { wasm_destroy_script(&((*yyvaluep).script)); } -#line 1949 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ +#line 1976 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1257 */ break; @@ -2237,18 +2264,18 @@ yyreduce: switch (yyn) { case 2: -#line 279 "src/ast-parser.y" /* yacc.c:1646 */ +#line 298 "src/ast-parser.y" /* yacc.c:1646 */ { WasmTextListNode* node = new_text_list_node(parser->allocator); DUPTEXT(node->text, (yyvsp[0].text)); node->next = NULL; (yyval.text_list).first = (yyval.text_list).last = node; } -#line 2248 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2275 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 3: -#line 285 "src/ast-parser.y" /* yacc.c:1646 */ +#line 304 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.text_list) = (yyvsp[-1].text_list); WasmTextListNode* node = new_text_list_node(parser->allocator); @@ -2257,17 +2284,17 @@ yyreduce: (yyval.text_list).last->next = node; (yyval.text_list).last = node; } -#line 2261 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2288 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 4: -#line 295 "src/ast-parser.y" /* yacc.c:1646 */ +#line 314 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.text_list).first = (yyval.text_list).last = NULL; } -#line 2267 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2294 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 6: -#line 300 "src/ast-parser.y" /* yacc.c:1646 */ +#line 319 "src/ast-parser.y" /* yacc.c:1646 */ { WasmTextListNode node; node.text = (yyvsp[0].text); @@ -2281,130 +2308,130 @@ yyreduce: (yyval.text).start = data; (yyval.text).length = size; } -#line 2285 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2312 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 7: -#line 318 "src/ast-parser.y" /* yacc.c:1646 */ +#line 337 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.types)); } -#line 2291 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2318 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 8: -#line 319 "src/ast-parser.y" /* yacc.c:1646 */ +#line 338 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.types) = (yyvsp[-1].types); wasm_append_type_value(parser->allocator, &(yyval.types), &(yyvsp[0].type)); } -#line 2300 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2327 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 9: -#line 325 "src/ast-parser.y" /* yacc.c:1646 */ +#line 344 "src/ast-parser.y" /* yacc.c:1646 */ {} -#line 2306 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2333 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 10: -#line 328 "src/ast-parser.y" /* yacc.c:1646 */ +#line 347 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.global)); (yyval.global).type = (yyvsp[0].type); (yyval.global).mutable_ = WASM_FALSE; } -#line 2316 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2343 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 11: -#line 333 "src/ast-parser.y" /* yacc.c:1646 */ +#line 352 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.global)); (yyval.global).type = (yyvsp[-1].type); (yyval.global).mutable_ = WASM_TRUE; } -#line 2326 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2353 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 12: -#line 340 "src/ast-parser.y" /* yacc.c:1646 */ +#line 359 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.func_sig) = (yyvsp[-1].func_sig); } -#line 2332 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2359 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 13: -#line 343 "src/ast-parser.y" /* yacc.c:1646 */ +#line 362 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.func_sig)); } -#line 2338 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2365 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 14: -#line 344 "src/ast-parser.y" /* yacc.c:1646 */ +#line 363 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.func_sig)); (yyval.func_sig).param_types = (yyvsp[-1].types); } -#line 2347 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2374 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 15: -#line 348 "src/ast-parser.y" /* yacc.c:1646 */ +#line 367 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.func_sig)); (yyval.func_sig).param_types = (yyvsp[-5].types); (yyval.func_sig).result_types = (yyvsp[-1].types); } -#line 2357 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2384 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 16: -#line 353 "src/ast-parser.y" /* yacc.c:1646 */ +#line 372 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.func_sig)); (yyval.func_sig).result_types = (yyvsp[-1].types); } -#line 2366 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2393 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 17: -#line 360 "src/ast-parser.y" /* yacc.c:1646 */ +#line 379 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.table).elem_limits = (yyvsp[-1].limits); } -#line 2372 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2399 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 18: -#line 363 "src/ast-parser.y" /* yacc.c:1646 */ +#line 382 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.memory).page_limits = (yyvsp[0].limits); } -#line 2378 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2405 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 19: -#line 366 "src/ast-parser.y" /* yacc.c:1646 */ +#line 385 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.limits).has_max = WASM_FALSE; (yyval.limits).initial = (yyvsp[0].u64); (yyval.limits).max = 0; } -#line 2388 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2415 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 20: -#line 371 "src/ast-parser.y" /* yacc.c:1646 */ +#line 390 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.limits).has_max = WASM_TRUE; (yyval.limits).initial = (yyvsp[-1].u64); (yyval.limits).max = (yyvsp[0].u64); } -#line 2398 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2425 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 21: -#line 378 "src/ast-parser.y" /* yacc.c:1646 */ +#line 397 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.var) = (yyvsp[-1].var); } -#line 2404 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2431 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 22: -#line 384 "src/ast-parser.y" /* yacc.c:1646 */ +#line 403 "src/ast-parser.y" /* yacc.c:1646 */ { if (WASM_FAILED(wasm_parse_uint64((yyvsp[0].literal).text.start, (yyvsp[0].literal).text.start + (yyvsp[0].literal).text.length, &(yyval.u64)))) { @@ -2413,97 +2440,97 @@ yyreduce: WASM_PRINTF_STRING_SLICE_ARG((yyvsp[0].literal).text)); } } -#line 2417 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2444 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 23: -#line 395 "src/ast-parser.y" /* yacc.c:1646 */ +#line 414 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.literal).type = (yyvsp[0].literal).type; DUPTEXT((yyval.literal).text, (yyvsp[0].literal).text); } -#line 2426 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2453 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 24: -#line 399 "src/ast-parser.y" /* yacc.c:1646 */ +#line 418 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.literal).type = (yyvsp[0].literal).type; DUPTEXT((yyval.literal).text, (yyvsp[0].literal).text); } -#line 2435 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2462 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 25: -#line 403 "src/ast-parser.y" /* yacc.c:1646 */ +#line 422 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.literal).type = (yyvsp[0].literal).type; DUPTEXT((yyval.literal).text, (yyvsp[0].literal).text); } -#line 2444 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2471 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 26: -#line 410 "src/ast-parser.y" /* yacc.c:1646 */ +#line 429 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.var).loc = (yylsp[0]); (yyval.var).type = WASM_VAR_TYPE_INDEX; (yyval.var).index = (yyvsp[0].u64); } -#line 2454 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2481 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 27: -#line 415 "src/ast-parser.y" /* yacc.c:1646 */ +#line 434 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.var).loc = (yylsp[0]); (yyval.var).type = WASM_VAR_TYPE_NAME; DUPTEXT((yyval.var).name, (yyvsp[0].text)); } -#line 2464 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2491 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 28: -#line 422 "src/ast-parser.y" /* yacc.c:1646 */ +#line 441 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.vars)); } -#line 2470 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2497 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 29: -#line 423 "src/ast-parser.y" /* yacc.c:1646 */ +#line 442 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.vars) = (yyvsp[-1].vars); wasm_append_var_value(parser->allocator, &(yyval.vars), &(yyvsp[0].var)); } -#line 2479 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2506 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 30: -#line 429 "src/ast-parser.y" /* yacc.c:1646 */ +#line 448 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.text)); } -#line 2485 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2512 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 32: -#line 433 "src/ast-parser.y" /* yacc.c:1646 */ +#line 452 "src/ast-parser.y" /* yacc.c:1646 */ { DUPTEXT((yyval.text), (yyvsp[0].text)); } -#line 2491 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2518 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 33: -#line 437 "src/ast-parser.y" /* yacc.c:1646 */ +#line 456 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.text)); } -#line 2497 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2524 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 35: -#line 442 "src/ast-parser.y" /* yacc.c:1646 */ +#line 461 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.u64) = 0; } -#line 2503 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2530 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 36: -#line 443 "src/ast-parser.y" /* yacc.c:1646 */ +#line 462 "src/ast-parser.y" /* yacc.c:1646 */ { if (WASM_FAILED(wasm_parse_int64((yyvsp[0].text).start, (yyvsp[0].text).start + (yyvsp[0].text).length, &(yyval.u64), WASM_PARSE_SIGNED_AND_UNSIGNED))) { @@ -2512,17 +2539,17 @@ yyreduce: WASM_PRINTF_STRING_SLICE_ARG((yyvsp[0].text))); } } -#line 2516 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2543 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 37: -#line 453 "src/ast-parser.y" /* yacc.c:1646 */ +#line 472 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.u32) = USE_NATURAL_ALIGNMENT; } -#line 2522 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2549 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 38: -#line 454 "src/ast-parser.y" /* yacc.c:1646 */ +#line 473 "src/ast-parser.y" /* yacc.c:1646 */ { if (WASM_FAILED(wasm_parse_int32((yyvsp[0].text).start, (yyvsp[0].text).start + (yyvsp[0].text).length, &(yyval.u32), WASM_PARSE_UNSIGNED_ONLY))) { @@ -2531,182 +2558,182 @@ yyreduce: WASM_PRINTF_STRING_SLICE_ARG((yyvsp[0].text))); } } -#line 2535 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2562 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 39: -#line 465 "src/ast-parser.y" /* yacc.c:1646 */ +#line 484 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr_list) = join_exprs1(&(yylsp[0]), (yyvsp[0].expr)); } -#line 2541 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2568 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 40: -#line 466 "src/ast-parser.y" /* yacc.c:1646 */ +#line 485 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr_list) = join_exprs1(&(yylsp[0]), (yyvsp[0].expr)); } -#line 2547 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2574 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 41: -#line 467 "src/ast-parser.y" /* yacc.c:1646 */ +#line 486 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr_list) = (yyvsp[0].expr_list); } -#line 2553 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2580 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 42: -#line 470 "src/ast-parser.y" /* yacc.c:1646 */ +#line 489 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_unreachable_expr(parser->allocator); } -#line 2561 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2588 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 43: -#line 473 "src/ast-parser.y" /* yacc.c:1646 */ +#line 492 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_nop_expr(parser->allocator); } -#line 2569 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2596 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 44: -#line 476 "src/ast-parser.y" /* yacc.c:1646 */ +#line 495 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_drop_expr(parser->allocator); } -#line 2577 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2604 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 45: -#line 479 "src/ast-parser.y" /* yacc.c:1646 */ +#line 498 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_select_expr(parser->allocator); } -#line 2585 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2612 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 46: -#line 482 "src/ast-parser.y" /* yacc.c:1646 */ +#line 501 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_br_expr(parser->allocator); (yyval.expr)->br.var = (yyvsp[0].var); } -#line 2594 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2621 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 47: -#line 486 "src/ast-parser.y" /* yacc.c:1646 */ +#line 505 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_br_if_expr(parser->allocator); (yyval.expr)->br_if.var = (yyvsp[0].var); } -#line 2603 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2630 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 48: -#line 490 "src/ast-parser.y" /* yacc.c:1646 */ +#line 509 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_br_table_expr(parser->allocator); (yyval.expr)->br_table.targets = (yyvsp[-1].vars); (yyval.expr)->br_table.default_target = (yyvsp[0].var); } -#line 2613 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2640 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 49: -#line 495 "src/ast-parser.y" /* yacc.c:1646 */ +#line 514 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_return_expr(parser->allocator); } -#line 2621 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2648 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 50: -#line 498 "src/ast-parser.y" /* yacc.c:1646 */ +#line 517 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_call_expr(parser->allocator); (yyval.expr)->call.var = (yyvsp[0].var); } -#line 2630 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2657 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 51: -#line 502 "src/ast-parser.y" /* yacc.c:1646 */ +#line 521 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_call_indirect_expr(parser->allocator); (yyval.expr)->call_indirect.var = (yyvsp[0].var); } -#line 2639 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2666 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 52: -#line 506 "src/ast-parser.y" /* yacc.c:1646 */ +#line 525 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_get_local_expr(parser->allocator); (yyval.expr)->get_local.var = (yyvsp[0].var); } -#line 2648 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2675 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 53: -#line 510 "src/ast-parser.y" /* yacc.c:1646 */ +#line 529 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_set_local_expr(parser->allocator); (yyval.expr)->set_local.var = (yyvsp[0].var); } -#line 2657 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2684 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 54: -#line 514 "src/ast-parser.y" /* yacc.c:1646 */ +#line 533 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_tee_local_expr(parser->allocator); (yyval.expr)->tee_local.var = (yyvsp[0].var); } -#line 2666 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2693 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 55: -#line 518 "src/ast-parser.y" /* yacc.c:1646 */ +#line 537 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_get_global_expr(parser->allocator); (yyval.expr)->get_global.var = (yyvsp[0].var); } -#line 2675 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2702 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 56: -#line 522 "src/ast-parser.y" /* yacc.c:1646 */ +#line 541 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_set_global_expr(parser->allocator); (yyval.expr)->set_global.var = (yyvsp[0].var); } -#line 2684 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2711 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 57: -#line 526 "src/ast-parser.y" /* yacc.c:1646 */ +#line 545 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_load_expr(parser->allocator); (yyval.expr)->load.opcode = (yyvsp[-2].opcode); (yyval.expr)->load.offset = (yyvsp[-1].u64); (yyval.expr)->load.align = (yyvsp[0].u32); } -#line 2695 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2722 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 58: -#line 532 "src/ast-parser.y" /* yacc.c:1646 */ +#line 551 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_store_expr(parser->allocator); (yyval.expr)->store.opcode = (yyvsp[-2].opcode); (yyval.expr)->store.offset = (yyvsp[-1].u64); (yyval.expr)->store.align = (yyvsp[0].u32); } -#line 2706 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2733 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 59: -#line 538 "src/ast-parser.y" /* yacc.c:1646 */ +#line 557 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_const_expr(parser->allocator); (yyval.expr)->const_.loc = (yylsp[-1]); @@ -2719,150 +2746,155 @@ yyreduce: } wasm_free(parser->allocator, (char*)(yyvsp[0].literal).text.start); } -#line 2723 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2750 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 60: -#line 550 "src/ast-parser.y" /* yacc.c:1646 */ +#line 569 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_unary_expr(parser->allocator); (yyval.expr)->unary.opcode = (yyvsp[0].opcode); } -#line 2732 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2759 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 61: -#line 554 "src/ast-parser.y" /* yacc.c:1646 */ +#line 573 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_binary_expr(parser->allocator); (yyval.expr)->binary.opcode = (yyvsp[0].opcode); } -#line 2741 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2768 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 62: -#line 558 "src/ast-parser.y" /* yacc.c:1646 */ +#line 577 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_compare_expr(parser->allocator); (yyval.expr)->compare.opcode = (yyvsp[0].opcode); } -#line 2750 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2777 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 63: -#line 562 "src/ast-parser.y" /* yacc.c:1646 */ +#line 581 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_convert_expr(parser->allocator); (yyval.expr)->convert.opcode = (yyvsp[0].opcode); } -#line 2759 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2786 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 64: -#line 566 "src/ast-parser.y" /* yacc.c:1646 */ +#line 585 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_current_memory_expr(parser->allocator); } -#line 2767 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2794 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 65: -#line 569 "src/ast-parser.y" /* yacc.c:1646 */ +#line 588 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_grow_memory_expr(parser->allocator); } -#line 2775 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2802 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 66: -#line 574 "src/ast-parser.y" /* yacc.c:1646 */ +#line 593 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_block_expr(parser->allocator); - (yyval.expr)->block = (yyvsp[-1].block); - (yyval.expr)->block.label = (yyvsp[-2].text); + (yyval.expr)->block = (yyvsp[-2].block); + (yyval.expr)->block.label = (yyvsp[-3].text); + CHECK_END_LABEL((yylsp[0]), (yyval.expr)->block.label, (yyvsp[0].text)); } -#line 2785 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2813 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 67: -#line 579 "src/ast-parser.y" /* yacc.c:1646 */ +#line 599 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_loop_expr(parser->allocator); - (yyval.expr)->loop = (yyvsp[-1].block); - (yyval.expr)->loop.label = (yyvsp[-2].text); + (yyval.expr)->loop = (yyvsp[-2].block); + (yyval.expr)->loop.label = (yyvsp[-3].text); + CHECK_END_LABEL((yylsp[0]), (yyval.expr)->block.label, (yyvsp[0].text)); } -#line 2795 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2824 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 68: -#line 584 "src/ast-parser.y" /* yacc.c:1646 */ +#line 605 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_if_expr(parser->allocator); - (yyval.expr)->if_.true_ = (yyvsp[-1].block); - (yyval.expr)->if_.true_.label = (yyvsp[-2].text); + (yyval.expr)->if_.true_ = (yyvsp[-2].block); + (yyval.expr)->if_.true_.label = (yyvsp[-3].text); + CHECK_END_LABEL((yylsp[0]), (yyval.expr)->block.label, (yyvsp[0].text)); } -#line 2805 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2835 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 69: -#line 589 "src/ast-parser.y" /* yacc.c:1646 */ +#line 611 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr) = wasm_new_if_expr(parser->allocator); - (yyval.expr)->if_.true_ = (yyvsp[-3].block); - (yyval.expr)->if_.true_.label = (yyvsp[-4].text); - (yyval.expr)->if_.false_ = (yyvsp[-1].expr_list).first; + (yyval.expr)->if_.true_ = (yyvsp[-5].block); + (yyval.expr)->if_.true_.label = (yyvsp[-6].text); + (yyval.expr)->if_.false_ = (yyvsp[-2].expr_list).first; + CHECK_END_LABEL((yylsp[-3]), (yyval.expr)->block.label, (yyvsp[-3].text)); + CHECK_END_LABEL((yylsp[0]), (yyval.expr)->block.label, (yyvsp[0].text)); } -#line 2816 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2848 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 70: -#line 597 "src/ast-parser.y" /* yacc.c:1646 */ +#line 621 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.block)); (yyval.block).sig = (yyvsp[-1].types); (yyval.block).first = (yyvsp[0].expr_list).first; } -#line 2826 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2858 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 71: -#line 605 "src/ast-parser.y" /* yacc.c:1646 */ +#line 629 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr_list) = (yyvsp[-1].expr_list); } -#line 2832 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2864 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 72: -#line 609 "src/ast-parser.y" /* yacc.c:1646 */ +#line 633 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr_list) = join_exprs2(&(yylsp[-1]), &(yyvsp[0].expr_list), (yyvsp[-1].expr)); } -#line 2840 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2872 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 73: -#line 612 "src/ast-parser.y" /* yacc.c:1646 */ +#line 636 "src/ast-parser.y" /* yacc.c:1646 */ { WasmExpr* expr = wasm_new_block_expr(parser->allocator); expr->block = (yyvsp[0].block); expr->block.label = (yyvsp[-1].text); (yyval.expr_list) = join_exprs1(&(yylsp[-2]), expr); } -#line 2851 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2883 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 74: -#line 618 "src/ast-parser.y" /* yacc.c:1646 */ +#line 642 "src/ast-parser.y" /* yacc.c:1646 */ { WasmExpr* expr = wasm_new_loop_expr(parser->allocator); expr->loop = (yyvsp[0].block); expr->loop.label = (yyvsp[-1].text); (yyval.expr_list) = join_exprs1(&(yylsp[-2]), expr); } -#line 2862 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2894 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 75: -#line 624 "src/ast-parser.y" /* yacc.c:1646 */ +#line 648 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr_list) = (yyvsp[0].expr_list); WasmExpr* if_ = (yyvsp[0].expr_list).last; @@ -2870,130 +2902,130 @@ yyreduce: if_->if_.true_.label = (yyvsp[-2].text); if_->if_.true_.sig = (yyvsp[-1].types); } -#line 2874 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2906 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 76: -#line 633 "src/ast-parser.y" /* yacc.c:1646 */ +#line 657 "src/ast-parser.y" /* yacc.c:1646 */ { WasmExpr* expr = wasm_new_if_expr(parser->allocator); expr->if_.true_.first = (yyvsp[-5].expr_list).first; expr->if_.false_ = (yyvsp[-1].expr_list).first; (yyval.expr_list) = join_exprs1(&(yylsp[-7]), expr); } -#line 2885 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2917 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 77: -#line 639 "src/ast-parser.y" /* yacc.c:1646 */ +#line 663 "src/ast-parser.y" /* yacc.c:1646 */ { WasmExpr* expr = wasm_new_if_expr(parser->allocator); expr->if_.true_.first = (yyvsp[-1].expr_list).first; (yyval.expr_list) = join_exprs1(&(yylsp[-3]), expr); } -#line 2895 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2927 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 78: -#line 644 "src/ast-parser.y" /* yacc.c:1646 */ +#line 668 "src/ast-parser.y" /* yacc.c:1646 */ { WasmExpr* expr = wasm_new_if_expr(parser->allocator); expr->if_.true_.first = (yyvsp[-5].expr_list).first; expr->if_.false_ = (yyvsp[-1].expr_list).first; (yyval.expr_list) = join_exprs2(&(yylsp[-8]), &(yyvsp[-8].expr_list), expr); } -#line 2906 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2938 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 79: -#line 650 "src/ast-parser.y" /* yacc.c:1646 */ +#line 674 "src/ast-parser.y" /* yacc.c:1646 */ { WasmExpr* expr = wasm_new_if_expr(parser->allocator); expr->if_.true_.first = (yyvsp[-1].expr_list).first; (yyval.expr_list) = join_exprs2(&(yylsp[-4]), &(yyvsp[-4].expr_list), expr); } -#line 2916 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2948 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 80: -#line 655 "src/ast-parser.y" /* yacc.c:1646 */ +#line 679 "src/ast-parser.y" /* yacc.c:1646 */ { WasmExpr* expr = wasm_new_if_expr(parser->allocator); expr->if_.true_.first = (yyvsp[-1].expr_list).first; expr->if_.false_ = (yyvsp[0].expr_list).first; (yyval.expr_list) = join_exprs2(&(yylsp[-2]), &(yyvsp[-2].expr_list), expr); } -#line 2927 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2959 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 81: -#line 661 "src/ast-parser.y" /* yacc.c:1646 */ +#line 685 "src/ast-parser.y" /* yacc.c:1646 */ { WasmExpr* expr = wasm_new_if_expr(parser->allocator); expr->if_.true_.first = (yyvsp[0].expr_list).first; (yyval.expr_list) = join_exprs2(&(yylsp[-1]), &(yyvsp[-1].expr_list), expr); } -#line 2937 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2969 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 82: -#line 669 "src/ast-parser.y" /* yacc.c:1646 */ +#line 693 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.expr_list)); } -#line 2943 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2975 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 83: -#line 670 "src/ast-parser.y" /* yacc.c:1646 */ +#line 694 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr_list).first = (yyvsp[-1].expr_list).first; (yyvsp[-1].expr_list).last->next = (yyvsp[0].expr_list).first; (yyval.expr_list).last = (yyvsp[0].expr_list).last ? (yyvsp[0].expr_list).last : (yyvsp[-1].expr_list).last; (yyval.expr_list).size = (yyvsp[-1].expr_list).size + (yyvsp[0].expr_list).size; } -#line 2954 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2986 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 84: -#line 678 "src/ast-parser.y" /* yacc.c:1646 */ +#line 702 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.expr_list)); } -#line 2960 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 2992 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 85: -#line 679 "src/ast-parser.y" /* yacc.c:1646 */ +#line 703 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr_list).first = (yyvsp[-1].expr_list).first; (yyvsp[-1].expr_list).last->next = (yyvsp[0].expr_list).first; (yyval.expr_list).last = (yyvsp[0].expr_list).last ? (yyvsp[0].expr_list).last : (yyvsp[-1].expr_list).last; (yyval.expr_list).size = (yyvsp[-1].expr_list).size + (yyvsp[0].expr_list).size; } -#line 2971 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3003 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 88: -#line 693 "src/ast-parser.y" /* yacc.c:1646 */ +#line 717 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.func_fields) = new_func_field(parser->allocator); (yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_RESULT_TYPES; (yyval.func_fields)->types = (yyvsp[-2].types); (yyval.func_fields)->next = (yyvsp[0].func_fields); } -#line 2982 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3014 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 89: -#line 699 "src/ast-parser.y" /* yacc.c:1646 */ +#line 723 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.func_fields) = new_func_field(parser->allocator); (yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_PARAM_TYPES; (yyval.func_fields)->types = (yyvsp[-2].types); (yyval.func_fields)->next = (yyvsp[0].func_fields); } -#line 2993 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3025 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 90: -#line 705 "src/ast-parser.y" /* yacc.c:1646 */ +#line 729 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.func_fields) = new_func_field(parser->allocator); (yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_BOUND_PARAM; @@ -3002,33 +3034,33 @@ yyreduce: (yyval.func_fields)->bound_type.type = (yyvsp[-2].type); (yyval.func_fields)->next = (yyvsp[0].func_fields); } -#line 3006 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3038 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 91: -#line 715 "src/ast-parser.y" /* yacc.c:1646 */ +#line 739 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.func_fields) = new_func_field(parser->allocator); (yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_EXPRS; (yyval.func_fields)->first_expr = (yyvsp[0].expr_list).first; (yyval.func_fields)->next = NULL; } -#line 3017 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3049 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 92: -#line 721 "src/ast-parser.y" /* yacc.c:1646 */ +#line 745 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.func_fields) = new_func_field(parser->allocator); (yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_LOCAL_TYPES; (yyval.func_fields)->types = (yyvsp[-2].types); (yyval.func_fields)->next = (yyvsp[0].func_fields); } -#line 3028 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3060 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 93: -#line 727 "src/ast-parser.y" /* yacc.c:1646 */ +#line 751 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.func_fields) = new_func_field(parser->allocator); (yyval.func_fields)->type = WASM_FUNC_FIELD_TYPE_BOUND_LOCAL; @@ -3037,11 +3069,11 @@ yyreduce: (yyval.func_fields)->bound_type.type = (yyvsp[-2].type); (yyval.func_fields)->next = (yyvsp[0].func_fields); } -#line 3041 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3073 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 94: -#line 737 "src/ast-parser.y" /* yacc.c:1646 */ +#line 761 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.func) = new_func(parser->allocator); WasmFuncField* field = (yyvsp[0].func_fields); @@ -3095,11 +3127,11 @@ yyreduce: field = next; } } -#line 3099 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3131 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 95: -#line 792 "src/ast-parser.y" /* yacc.c:1646 */ +#line 816 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.exported_func)); (yyval.exported_func).func = (yyvsp[-1].func); @@ -3108,11 +3140,11 @@ yyreduce: (yyval.exported_func).func->name = (yyvsp[-4].text); (yyval.exported_func).export_ = (yyvsp[-3].optional_export); } -#line 3112 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3144 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 96: -#line 801 "src/ast-parser.y" /* yacc.c:1646 */ +#line 825 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.exported_func)); (yyval.exported_func).func = (yyvsp[-1].func); @@ -3120,51 +3152,51 @@ yyreduce: (yyval.exported_func).func->decl.type_var = (yyvsp[-2].var); (yyval.exported_func).func->name = (yyvsp[-3].text); } -#line 3124 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3156 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 97: -#line 808 "src/ast-parser.y" /* yacc.c:1646 */ +#line 832 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.exported_func)); (yyval.exported_func).func = (yyvsp[-1].func); (yyval.exported_func).func->name = (yyvsp[-3].text); (yyval.exported_func).export_ = (yyvsp[-2].optional_export); } -#line 3135 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3167 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 98: -#line 815 "src/ast-parser.y" /* yacc.c:1646 */ +#line 839 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.exported_func)); (yyval.exported_func).func = (yyvsp[-1].func); (yyval.exported_func).func->name = (yyvsp[-2].text); } -#line 3145 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3177 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 99: -#line 825 "src/ast-parser.y" /* yacc.c:1646 */ +#line 849 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.expr_list) = (yyvsp[-1].expr_list); } -#line 3153 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3185 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 101: -#line 832 "src/ast-parser.y" /* yacc.c:1646 */ +#line 856 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.elem_segment)); (yyval.elem_segment).table_var = (yyvsp[-3].var); (yyval.elem_segment).offset = (yyvsp[-2].expr_list).first; (yyval.elem_segment).vars = (yyvsp[-1].vars); } -#line 3164 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3196 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 102: -#line 838 "src/ast-parser.y" /* yacc.c:1646 */ +#line 862 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.elem_segment)); (yyval.elem_segment).table_var.loc = (yylsp[-3]); @@ -3173,22 +3205,22 @@ yyreduce: (yyval.elem_segment).offset = (yyvsp[-2].expr_list).first; (yyval.elem_segment).vars = (yyvsp[-1].vars); } -#line 3177 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3209 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 103: -#line 849 "src/ast-parser.y" /* yacc.c:1646 */ +#line 873 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.exported_table).table = (yyvsp[-1].table); (yyval.exported_table).table.name = (yyvsp[-3].text); (yyval.exported_table).has_elem_segment = WASM_FALSE; (yyval.exported_table).export_ = (yyvsp[-2].optional_export); } -#line 3188 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3220 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 104: -#line 856 "src/ast-parser.y" /* yacc.c:1646 */ +#line 880 "src/ast-parser.y" /* yacc.c:1646 */ { WasmExpr* expr = wasm_new_const_expr(parser->allocator); expr->loc = (yylsp[-8]); @@ -3205,11 +3237,11 @@ yyreduce: (yyval.exported_table).elem_segment.vars = (yyvsp[-2].vars); (yyval.exported_table).export_ = (yyvsp[-6].optional_export); } -#line 3209 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3241 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 105: -#line 875 "src/ast-parser.y" /* yacc.c:1646 */ +#line 899 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.data_segment)); (yyval.data_segment).memory_var = (yyvsp[-3].var); @@ -3217,11 +3249,11 @@ yyreduce: dup_text_list(parser->allocator, &(yyvsp[-1].text_list), &(yyval.data_segment).data, &(yyval.data_segment).size); wasm_destroy_text_list(parser->allocator, &(yyvsp[-1].text_list)); } -#line 3221 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3253 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 106: -#line 882 "src/ast-parser.y" /* yacc.c:1646 */ +#line 906 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.data_segment)); (yyval.data_segment).memory_var.loc = (yylsp[-3]); @@ -3231,11 +3263,11 @@ yyreduce: dup_text_list(parser->allocator, &(yyvsp[-1].text_list), &(yyval.data_segment).data, &(yyval.data_segment).size); wasm_destroy_text_list(parser->allocator, &(yyvsp[-1].text_list)); } -#line 3235 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3267 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 107: -#line 894 "src/ast-parser.y" /* yacc.c:1646 */ +#line 918 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.exported_memory)); (yyval.exported_memory).memory = (yyvsp[-1].memory); @@ -3243,11 +3275,11 @@ yyreduce: (yyval.exported_memory).has_data_segment = WASM_FALSE; (yyval.exported_memory).export_ = (yyvsp[-2].optional_export); } -#line 3247 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3279 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 108: -#line 901 "src/ast-parser.y" /* yacc.c:1646 */ +#line 925 "src/ast-parser.y" /* yacc.c:1646 */ { WasmExpr* expr = wasm_new_const_expr(parser->allocator); expr->loc = (yylsp[-7]); @@ -3268,11 +3300,11 @@ yyreduce: (yyval.exported_memory).memory.page_limits.has_max = WASM_TRUE; (yyval.exported_memory).export_ = (yyvsp[-5].optional_export); } -#line 3272 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3304 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 109: -#line 922 "src/ast-parser.y" /* yacc.c:1646 */ +#line 946 "src/ast-parser.y" /* yacc.c:1646 */ { WasmExpr* expr = wasm_new_const_expr(parser->allocator); expr->loc = (yylsp[-6]); @@ -3293,11 +3325,11 @@ yyreduce: (yyval.exported_memory).memory.page_limits.has_max = WASM_TRUE; (yyval.exported_memory).export_.has_export = WASM_FALSE; } -#line 3297 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3329 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 110: -#line 945 "src/ast-parser.y" /* yacc.c:1646 */ +#line 969 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.exported_global)); (yyval.exported_global).global = (yyvsp[-2].global); @@ -3305,11 +3337,11 @@ yyreduce: (yyval.exported_global).global.init_expr = (yyvsp[-1].expr_list).first; (yyval.exported_global).export_ = (yyvsp[-3].optional_export); } -#line 3309 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3341 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 111: -#line 952 "src/ast-parser.y" /* yacc.c:1646 */ +#line 976 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.exported_global)); (yyval.exported_global).global = (yyvsp[-2].global); @@ -3317,11 +3349,11 @@ yyreduce: (yyval.exported_global).global.init_expr = (yyvsp[-1].expr_list).first; (yyval.exported_global).export_.has_export = WASM_FALSE; } -#line 3321 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3353 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 112: -#line 965 "src/ast-parser.y" /* yacc.c:1646 */ +#line 989 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = new_import(parser->allocator); (yyval.import)->kind = WASM_EXTERNAL_KIND_FUNC; @@ -3329,65 +3361,65 @@ yyreduce: (yyval.import)->func.decl.flags = WASM_FUNC_DECLARATION_FLAG_HAS_FUNC_TYPE; (yyval.import)->func.decl.type_var = (yyvsp[-1].var); } -#line 3333 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3365 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 113: -#line 972 "src/ast-parser.y" /* yacc.c:1646 */ +#line 996 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = new_import(parser->allocator); (yyval.import)->kind = WASM_EXTERNAL_KIND_FUNC; (yyval.import)->func.name = (yyvsp[-2].text); (yyval.import)->func.decl.sig = (yyvsp[-1].func_sig); } -#line 3344 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3376 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 114: -#line 978 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1002 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = new_import(parser->allocator); (yyval.import)->kind = WASM_EXTERNAL_KIND_TABLE; (yyval.import)->table = (yyvsp[-1].table); (yyval.import)->table.name = (yyvsp[-2].text); } -#line 3355 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3387 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 115: -#line 984 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1008 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = new_import(parser->allocator); (yyval.import)->kind = WASM_EXTERNAL_KIND_MEMORY; (yyval.import)->memory = (yyvsp[-1].memory); (yyval.import)->memory.name = (yyvsp[-2].text); } -#line 3366 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3398 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 116: -#line 990 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1014 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = new_import(parser->allocator); (yyval.import)->kind = WASM_EXTERNAL_KIND_GLOBAL; (yyval.import)->global = (yyvsp[-1].global); (yyval.import)->global.name = (yyvsp[-2].text); } -#line 3377 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3409 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 117: -#line 998 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1022 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = (yyvsp[-1].import); (yyval.import)->module_name = (yyvsp[-3].text); (yyval.import)->field_name = (yyvsp[-2].text); } -#line 3387 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3419 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 118: -#line 1003 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1027 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = (yyvsp[-2].import); (yyval.import)->kind = WASM_EXTERNAL_KIND_FUNC; @@ -3395,165 +3427,165 @@ yyreduce: (yyval.import)->func.decl.flags = WASM_FUNC_DECLARATION_FLAG_HAS_FUNC_TYPE; (yyval.import)->func.decl.type_var = (yyvsp[-1].var); } -#line 3399 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3431 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 119: -#line 1010 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1034 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = (yyvsp[-2].import); (yyval.import)->kind = WASM_EXTERNAL_KIND_FUNC; (yyval.import)->func.name = (yyvsp[-3].text); (yyval.import)->func.decl.sig = (yyvsp[-1].func_sig); } -#line 3410 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3442 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 120: -#line 1016 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1040 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = (yyvsp[-2].import); (yyval.import)->kind = WASM_EXTERNAL_KIND_TABLE; (yyval.import)->table = (yyvsp[-1].table); (yyval.import)->table.name = (yyvsp[-3].text); } -#line 3421 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3453 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 121: -#line 1022 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1046 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = (yyvsp[-2].import); (yyval.import)->kind = WASM_EXTERNAL_KIND_MEMORY; (yyval.import)->memory = (yyvsp[-1].memory); (yyval.import)->memory.name = (yyvsp[-3].text); } -#line 3432 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3464 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 122: -#line 1028 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1052 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = (yyvsp[-2].import); (yyval.import)->kind = WASM_EXTERNAL_KIND_GLOBAL; (yyval.import)->global = (yyvsp[-1].global); (yyval.import)->global.name = (yyvsp[-3].text); } -#line 3443 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3475 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 123: -#line 1037 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1061 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.import) = new_import(parser->allocator); (yyval.import)->module_name = (yyvsp[-2].text); (yyval.import)->field_name = (yyvsp[-1].text); } -#line 3453 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3485 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 124: -#line 1045 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1069 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.export_)); (yyval.export_).kind = WASM_EXTERNAL_KIND_FUNC; (yyval.export_).var = (yyvsp[-1].var); } -#line 3463 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3495 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 125: -#line 1050 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1074 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.export_)); (yyval.export_).kind = WASM_EXTERNAL_KIND_TABLE; (yyval.export_).var = (yyvsp[-1].var); } -#line 3473 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3505 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 126: -#line 1055 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1079 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.export_)); (yyval.export_).kind = WASM_EXTERNAL_KIND_MEMORY; (yyval.export_).var = (yyvsp[-1].var); } -#line 3483 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3515 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 127: -#line 1060 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1084 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.export_)); (yyval.export_).kind = WASM_EXTERNAL_KIND_GLOBAL; (yyval.export_).var = (yyvsp[-1].var); } -#line 3493 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3525 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 128: -#line 1067 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1091 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.export_) = (yyvsp[-1].export_); (yyval.export_).name = (yyvsp[-2].text); } -#line 3502 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3534 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 129: -#line 1074 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1098 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.optional_export)); (yyval.optional_export).has_export = WASM_FALSE; } -#line 3511 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3543 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 131: -#line 1081 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1105 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.optional_export)); (yyval.optional_export).has_export = WASM_TRUE; (yyval.optional_export).export_.name = (yyvsp[-1].text); } -#line 3521 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3553 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 132: -#line 1092 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1116 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.func_type)); (yyval.func_type).sig = (yyvsp[-1].func_sig); } -#line 3530 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3562 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 133: -#line 1096 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1120 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.func_type).name = (yyvsp[-2].text); (yyval.func_type).sig = (yyvsp[-1].func_sig); } -#line 3539 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3571 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 134: -#line 1103 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1127 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.var) = (yyvsp[-1].var); } -#line 3545 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3577 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 135: -#line 1107 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1131 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.module) = new_module(parser->allocator); } -#line 3553 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3585 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 136: -#line 1110 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1134 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.module) = (yyvsp[-1].module); WasmModuleField* field; @@ -3562,11 +3594,11 @@ yyreduce: &field->func_type); INSERT_BINDING((yyval.module), func_type, func_types, (yylsp[0]), (yyvsp[0].func_type).name); } -#line 3566 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3598 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 137: -#line 1118 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1142 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.module) = (yyvsp[-1].module); WasmModuleField* field; @@ -3575,11 +3607,11 @@ yyreduce: INSERT_BINDING((yyval.module), global, globals, (yylsp[0]), (yyvsp[0].exported_global).global.name); APPEND_INLINE_EXPORT((yyval.module), GLOBAL, (yylsp[0]), (yyvsp[0].exported_global), (yyval.module)->globals.size - 1); } -#line 3579 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3611 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 138: -#line 1126 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1150 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.module) = (yyvsp[-1].module); WasmModuleField* field; @@ -3597,11 +3629,11 @@ yyreduce: } } -#line 3601 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3633 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 139: -#line 1143 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1167 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.module) = (yyvsp[-1].module); WasmModuleField* field; @@ -3618,11 +3650,11 @@ yyreduce: &data_segment_field->data_segment); } } -#line 3622 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3654 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 140: -#line 1159 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1183 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.module) = (yyvsp[-1].module); WasmModuleField* field; @@ -3634,11 +3666,11 @@ yyreduce: APPEND_INLINE_EXPORT((yyval.module), FUNC, (yylsp[0]), (yyvsp[0].exported_func), (yyval.module)->funcs.size - 1); wasm_free(parser->allocator, (yyvsp[0].exported_func).func); } -#line 3638 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3670 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 141: -#line 1170 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1194 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.module) = (yyvsp[-1].module); WasmModuleField* field; @@ -3646,11 +3678,11 @@ yyreduce: APPEND_ITEM_TO_VECTOR((yyval.module), ElemSegment, elem_segment, elem_segments, &field->elem_segment); } -#line 3650 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3682 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 142: -#line 1177 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1201 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.module) = (yyvsp[-1].module); WasmModuleField* field; @@ -3658,22 +3690,22 @@ yyreduce: APPEND_ITEM_TO_VECTOR((yyval.module), DataSegment, data_segment, data_segments, &field->data_segment); } -#line 3662 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3694 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 143: -#line 1184 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1208 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.module) = (yyvsp[-1].module); WasmModuleField* field; APPEND_FIELD_TO_LIST((yyval.module), field, START, start, (yylsp[0]), (yyvsp[0].var)); (yyval.module)->start = &field->start; } -#line 3673 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3705 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 144: -#line 1190 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1214 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.module) = (yyvsp[-1].module); WasmModuleField* field; @@ -3714,11 +3746,11 @@ yyreduce: wasm_free(parser->allocator, (yyvsp[0].import)); APPEND_ITEM_TO_VECTOR((yyval.module), Import, import, imports, &field->import); } -#line 3718 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3750 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 145: -#line 1230 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1254 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.module) = (yyvsp[-1].module); WasmModuleField* field = wasm_append_module_field(parser->allocator, (yyval.module)); @@ -3726,11 +3758,11 @@ yyreduce: APPEND_ITEM_TO_VECTOR((yyval.module), Export, export, exports, &field->export_); INSERT_BINDING((yyval.module), export, exports, (yylsp[0]), (yyvsp[0].export_).name); } -#line 3730 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3762 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 146: -#line 1240 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1264 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.raw_module).type = WASM_RAW_MODULE_TYPE_TEXT; (yyval.raw_module).text = (yyvsp[-1].module); @@ -3753,11 +3785,11 @@ yyreduce: } } } -#line 3757 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3789 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 147: -#line 1262 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1286 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.raw_module).type = WASM_RAW_MODULE_TYPE_BINARY; (yyval.raw_module).binary.name = (yyvsp[-2].text); @@ -3765,11 +3797,11 @@ yyreduce: dup_text_list(parser->allocator, &(yyvsp[-1].text_list), &(yyval.raw_module).binary.data, &(yyval.raw_module).binary.size); wasm_destroy_text_list(parser->allocator, &(yyvsp[-1].text_list)); } -#line 3769 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3801 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 148: -#line 1272 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1296 "src/ast-parser.y" /* yacc.c:1646 */ { if ((yyvsp[0].raw_module).type == WASM_RAW_MODULE_TYPE_TEXT) { (yyval.module) = (yyvsp[0].raw_module).text; @@ -3791,31 +3823,31 @@ yyreduce: (yyval.module)->loc = (yyvsp[0].raw_module).binary.loc; } } -#line 3795 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3827 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 149: -#line 1298 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1322 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.var)); (yyval.var).type = WASM_VAR_TYPE_INDEX; (yyval.var).index = INVALID_VAR_INDEX; } -#line 3805 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3837 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 150: -#line 1303 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1327 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.var)); (yyval.var).type = WASM_VAR_TYPE_NAME; DUPTEXT((yyval.var).name, (yyvsp[0].text)); } -#line 3815 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3847 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 151: -#line 1311 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1335 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.action)); (yyval.action).loc = (yylsp[-4]); @@ -3824,11 +3856,11 @@ yyreduce: (yyval.action).invoke.name = (yyvsp[-2].text); (yyval.action).invoke.args = (yyvsp[-1].consts); } -#line 3828 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3860 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 152: -#line 1319 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1343 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.action)); (yyval.action).loc = (yylsp[-3]); @@ -3836,108 +3868,108 @@ yyreduce: (yyval.action).type = WASM_ACTION_TYPE_GET; (yyval.action).invoke.name = (yyvsp[-1].text); } -#line 3840 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3872 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 153: -#line 1329 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1353 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.command) = new_command(parser->allocator); (yyval.command)->type = WASM_COMMAND_TYPE_ASSERT_MALFORMED; (yyval.command)->assert_malformed.module = (yyvsp[-2].raw_module); (yyval.command)->assert_malformed.text = (yyvsp[-1].text); } -#line 3851 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3883 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 154: -#line 1335 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1359 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.command) = new_command(parser->allocator); (yyval.command)->type = WASM_COMMAND_TYPE_ASSERT_INVALID; (yyval.command)->assert_invalid.module = (yyvsp[-2].raw_module); (yyval.command)->assert_invalid.text = (yyvsp[-1].text); } -#line 3862 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3894 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 155: -#line 1341 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1365 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.command) = new_command(parser->allocator); (yyval.command)->type = WASM_COMMAND_TYPE_ASSERT_UNLINKABLE; (yyval.command)->assert_unlinkable.module = (yyvsp[-2].raw_module); (yyval.command)->assert_unlinkable.text = (yyvsp[-1].text); } -#line 3873 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3905 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 156: -#line 1347 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1371 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.command) = new_command(parser->allocator); (yyval.command)->type = WASM_COMMAND_TYPE_ASSERT_UNINSTANTIABLE; (yyval.command)->assert_uninstantiable.module = (yyvsp[-2].raw_module); (yyval.command)->assert_uninstantiable.text = (yyvsp[-1].text); } -#line 3884 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3916 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 157: -#line 1353 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1377 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.command) = new_command(parser->allocator); (yyval.command)->type = WASM_COMMAND_TYPE_ASSERT_RETURN; (yyval.command)->assert_return.action = (yyvsp[-2].action); (yyval.command)->assert_return.expected = (yyvsp[-1].consts); } -#line 3895 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3927 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 158: -#line 1359 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1383 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.command) = new_command(parser->allocator); (yyval.command)->type = WASM_COMMAND_TYPE_ASSERT_RETURN_NAN; (yyval.command)->assert_return_nan.action = (yyvsp[-1].action); } -#line 3905 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3937 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 159: -#line 1364 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1388 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.command) = new_command(parser->allocator); (yyval.command)->type = WASM_COMMAND_TYPE_ASSERT_TRAP; (yyval.command)->assert_trap.action = (yyvsp[-2].action); (yyval.command)->assert_trap.text = (yyvsp[-1].text); } -#line 3916 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3948 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 160: -#line 1373 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1397 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.command) = new_command(parser->allocator); (yyval.command)->type = WASM_COMMAND_TYPE_ACTION; (yyval.command)->action = (yyvsp[0].action); } -#line 3926 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3958 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 162: -#line 1379 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1403 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.command) = new_command(parser->allocator); (yyval.command)->type = WASM_COMMAND_TYPE_MODULE; (yyval.command)->module = *(yyvsp[0].module); wasm_free(parser->allocator, (yyvsp[0].module)); } -#line 3937 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3969 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 163: -#line 1385 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1409 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.command) = new_command(parser->allocator); (yyval.command)->type = WASM_COMMAND_TYPE_REGISTER; @@ -3945,27 +3977,27 @@ yyreduce: (yyval.command)->register_.var = (yyvsp[-1].var); (yyval.command)->register_.var.loc = (yylsp[-1]); } -#line 3949 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3981 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 164: -#line 1394 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1418 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.commands)); } -#line 3955 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3987 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 165: -#line 1395 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1419 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.commands) = (yyvsp[-1].commands); wasm_append_command_value(parser->allocator, &(yyval.commands), (yyvsp[0].command)); wasm_free(parser->allocator, (yyvsp[0].command)); } -#line 3965 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 3997 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 166: -#line 1403 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1427 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.const_).loc = (yylsp[-2]); if (WASM_FAILED(parse_const((yyvsp[-2].type), (yyvsp[-1].literal).type, (yyvsp[-1].literal).text.start, @@ -3976,26 +4008,26 @@ yyreduce: } wasm_free(parser->allocator, (char*)(yyvsp[-1].literal).text.start); } -#line 3980 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 4012 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 167: -#line 1415 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1439 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.consts)); } -#line 3986 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 4018 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 168: -#line 1416 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1440 "src/ast-parser.y" /* yacc.c:1646 */ { (yyval.consts) = (yyvsp[-1].consts); wasm_append_const_value(parser->allocator, &(yyval.consts), &(yyvsp[0].const_)); } -#line 3995 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 4027 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; case 169: -#line 1423 "src/ast-parser.y" /* yacc.c:1646 */ +#line 1447 "src/ast-parser.y" /* yacc.c:1646 */ { WASM_ZERO_MEMORY((yyval.script)); (yyval.script).allocator = parser->allocator; @@ -4056,11 +4088,11 @@ yyreduce: } parser->script = (yyval.script); } -#line 4060 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 4092 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ break; -#line 4064 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ +#line 4096 "src/prebuilt/ast-parser-gen.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4295,7 +4327,7 @@ yyreturn: #endif return yyresult; } -#line 1491 "src/ast-parser.y" /* yacc.c:1906 */ +#line 1515 "src/ast-parser.y" /* yacc.c:1906 */ static void append_expr_list(WasmExprList* expr_list, WasmExprList* expr) { diff --git a/src/validator.c b/src/validator.c index c2fceb90..635dd3ba 100644 --- a/src/validator.c +++ b/src/validator.c @@ -67,6 +67,7 @@ typedef struct Context { int current_table_index; int current_memory_index; int current_global_index; + int num_imported_globals; WasmTypeVector type_stack; LabelNode* top_label; int max_depth; @@ -836,12 +837,15 @@ static void check_const_init_expr(Context* ctx, } type = ref_global->type; - /* globals can only reference previously defined globals */ + /* globals can only reference previously defined, internal globals */ if (ref_global_index >= ctx->current_global_index) { + print_error(ctx, loc, + "initializer expression can only reference a previously " + "defined global"); + } else if (ref_global_index >= ctx->num_imported_globals) { print_error( ctx, loc, - "initializer expression can only be reference a previously " - "defined global"); + "initializer expression can only reference an imported global"); } if (ref_global->mutable_) { @@ -962,6 +966,7 @@ static void check_import(Context* ctx, if (import->global.mutable_) { print_error(ctx, loc, "mutable globals cannot be imported"); } + ctx->num_imported_globals++; ctx->current_global_index++; break; case WASM_NUM_EXTERNAL_KINDS: @@ -1004,6 +1009,7 @@ static void check_module(Context* ctx, const WasmModule* module) { ctx->current_table_index = 0; ctx->current_memory_index = 0; ctx->current_global_index = 0; + ctx->num_imported_globals = 0; WasmModuleField* field; for (field = module->first_field; field != NULL; field = field->next) { diff --git a/test/dump/global.txt b/test/dump/global.txt index fe438097..2fab8acc 100644 --- a/test/dump/global.txt +++ b/test/dump/global.txt @@ -1,6 +1,11 @@ ;;; TOOL: run-wasmdump ;;; FLAGS: -v --dump-verbose (module + (import "foo" "i32_global" (global i32)) + (import "foo" "i64_global" (global i64)) + (import "foo" "f32_global" (global f32)) + (import "foo" "f64_global" (global f64)) + (global i32 (i32.const 1)) (global i64 (i64.const 2)) (global f32 (f32.const 3)) @@ -13,63 +18,105 @@ (;; STDOUT ;;; 0000000: 0061 736d ; WASM_BINARY_MAGIC 0000004: 0d00 0000 ; WASM_BINARY_VERSION -; section "GLOBAL" (6) -0000008: 06 ; section code +; section "IMPORT" (2) +0000008: 02 ; section code 0000009: 00 ; section size (guess) -000000a: 08 ; num globals -000000b: 7f ; i32 -000000c: 00 ; global mutability -000000d: 41 ; i32.const -000000e: 01 ; i32 literal -000000f: 0b ; end -0000010: 7e ; i64 -0000011: 00 ; global mutability -0000012: 42 ; i64.const -0000013: 02 ; i64 literal -0000014: 0b ; end -0000015: 7d ; f32 -0000016: 00 ; global mutability -0000017: 43 ; f32.const -0000018: 0000 4040 ; f32 literal -000001c: 0b ; end -000001d: 7c ; f64 -000001e: 00 ; global mutability -000001f: 44 ; f64.const -0000020: 0000 0000 0000 1040 ; f64 literal -0000028: 0b ; end -0000029: 7f ; i32 -000002a: 00 ; global mutability -000002b: 23 ; get_global -000002c: 00 ; global index -000002d: 0b ; end -000002e: 7e ; i64 -000002f: 00 ; global mutability -0000030: 23 ; get_global -0000031: 01 ; global index -0000032: 0b ; end -0000033: 7d ; f32 -0000034: 00 ; global mutability -0000035: 23 ; get_global -0000036: 02 ; global index -0000037: 0b ; end -0000038: 7c ; f64 -0000039: 00 ; global mutability -000003a: 23 ; get_global -000003b: 03 ; global index -000003c: 0b ; end -0000009: 33 ; FIXUP section size +000000a: 04 ; num imports +; import header 0 +000000b: 03 ; string length +000000c: 666f 6f foo ; import module name +000000f: 0a ; string length +0000010: 6933 325f 676c 6f62 616c i32_global ; import field name +000001a: 03 ; import kind +000001b: 7f ; i32 +000001c: 00 ; global mutability +; import header 1 +000001d: 03 ; string length +000001e: 666f 6f foo ; import module name +0000021: 0a ; string length +0000022: 6936 345f 676c 6f62 616c i64_global ; import field name +000002c: 03 ; import kind +000002d: 7e ; i64 +000002e: 00 ; global mutability +; import header 2 +000002f: 03 ; string length +0000030: 666f 6f foo ; import module name +0000033: 0a ; string length +0000034: 6633 325f 676c 6f62 616c f32_global ; import field name +000003e: 03 ; import kind +000003f: 7d ; f32 +0000040: 00 ; global mutability +; import header 3 +0000041: 03 ; string length +0000042: 666f 6f foo ; import module name +0000045: 0a ; string length +0000046: 6636 345f 676c 6f62 616c f64_global ; import field name +0000050: 03 ; import kind +0000051: 7c ; f64 +0000052: 00 ; global mutability +0000009: 49 ; FIXUP section size +; section "GLOBAL" (6) +0000053: 06 ; section code +0000054: 00 ; section size (guess) +0000055: 08 ; num globals +0000056: 7f ; i32 +0000057: 00 ; global mutability +0000058: 41 ; i32.const +0000059: 01 ; i32 literal +000005a: 0b ; end +000005b: 7e ; i64 +000005c: 00 ; global mutability +000005d: 42 ; i64.const +000005e: 02 ; i64 literal +000005f: 0b ; end +0000060: 7d ; f32 +0000061: 00 ; global mutability +0000062: 43 ; f32.const +0000063: 0000 4040 ; f32 literal +0000067: 0b ; end +0000068: 7c ; f64 +0000069: 00 ; global mutability +000006a: 44 ; f64.const +000006b: 0000 0000 0000 1040 ; f64 literal +0000073: 0b ; end +0000074: 7f ; i32 +0000075: 00 ; global mutability +0000076: 23 ; get_global +0000077: 00 ; global index +0000078: 0b ; end +0000079: 7e ; i64 +000007a: 00 ; global mutability +000007b: 23 ; get_global +000007c: 01 ; global index +000007d: 0b ; end +000007e: 7d ; f32 +000007f: 00 ; global mutability +0000080: 23 ; get_global +0000081: 02 ; global index +0000082: 0b ; end +0000083: 7c ; f64 +0000084: 00 ; global mutability +0000085: 23 ; get_global +0000086: 03 ; global index +0000087: 0b ; end +0000054: 33 ; FIXUP section size global.wasm: file format wasm 0x00000d Section Details: +IMPORT: + - global[0] i32 mutable=0 <- foo.i32_global + - global[1] i64 mutable=0 <- foo.i64_global + - global[2] f32 mutable=0 <- foo.f32_global + - global[3] f64 mutable=0 <- foo.f64_global GLOBAL: - - global[0] i32 mutable=0 - init i32=1 - - global[1] i64 mutable=0 - init i64=2 - - global[2] f32 mutable=0 - init f32=0x1.8p+1 - - global[3] f64 mutable=0 - init f64=0x0p+0 - - global[4] i32 mutable=0 - init global=0 - - global[5] i64 mutable=0 - init global=1 - - global[6] f32 mutable=0 - init global=2 - - global[7] f64 mutable=0 - init global=3 + - global[4] i32 mutable=0 - init i32=1 + - global[5] i64 mutable=0 - init i64=2 + - global[6] f32 mutable=0 - init f32=0x1.8p+1 + - global[7] f64 mutable=0 - init f64=0x0p+0 + - global[8] i32 mutable=0 - init global=0 + - global[9] i64 mutable=0 - init global=1 + - global[10] f32 mutable=0 - init global=2 + - global[11] f64 mutable=0 - init global=3 Code Disassembly: ;;; STDOUT ;;) diff --git a/test/parse/expr/bad-block-end-label.txt b/test/parse/expr/bad-block-end-label.txt new file mode 100644 index 00000000..75460cb3 --- /dev/null +++ b/test/parse/expr/bad-block-end-label.txt @@ -0,0 +1,10 @@ +;;; ERROR: 1 +(module + (func + block + end $foo)) +(;; STDERR ;;; +parse/expr/bad-block-end-label.txt:5:9: unexpected label "$foo" + end $foo)) + ^^^^ +;;; STDERR ;;) diff --git a/test/parse/expr/bad-block-mismatch-label.txt b/test/parse/expr/bad-block-mismatch-label.txt new file mode 100644 index 00000000..74d59e5e --- /dev/null +++ b/test/parse/expr/bad-block-mismatch-label.txt @@ -0,0 +1,10 @@ +;;; ERROR: 1 +(module + (func + block $foo + end $bar)) +(;; STDERR ;;; +parse/expr/bad-block-mismatch-label.txt:5:9: mismatching label "$foo" != "$bar" + end $bar)) + ^^^^ +;;; STDERR ;;) diff --git a/test/parse/expr/bad-if-end-label.txt b/test/parse/expr/bad-if-end-label.txt new file mode 100644 index 00000000..e5fa8fd6 --- /dev/null +++ b/test/parse/expr/bad-if-end-label.txt @@ -0,0 +1,15 @@ +;;; ERROR: 1 +(module + (func + i32.const 0 + if + else $foo + end $bar)) +(;; STDERR ;;; +parse/expr/bad-if-end-label.txt:6:10: unexpected label "$foo" + else $foo + ^^^^ +parse/expr/bad-if-end-label.txt:7:9: unexpected label "$bar" + end $bar)) + ^^^^ +;;; STDERR ;;) diff --git a/test/parse/expr/bad-if-mismatch-label.txt b/test/parse/expr/bad-if-mismatch-label.txt new file mode 100644 index 00000000..abf6817e --- /dev/null +++ b/test/parse/expr/bad-if-mismatch-label.txt @@ -0,0 +1,15 @@ +;;; ERROR: 1 +(module + (func + i32.const 1 + if $foo + else $bar + end $baz)) +(;; STDERR ;;; +parse/expr/bad-if-mismatch-label.txt:6:10: mismatching label "$foo" != "$bar" + else $bar + ^^^^ +parse/expr/bad-if-mismatch-label.txt:7:9: mismatching label "$foo" != "$baz" + end $baz)) + ^^^^ +;;; STDERR ;;) diff --git a/test/parse/expr/bad-loop-end-label.txt b/test/parse/expr/bad-loop-end-label.txt new file mode 100644 index 00000000..6d77694e --- /dev/null +++ b/test/parse/expr/bad-loop-end-label.txt @@ -0,0 +1,10 @@ +;;; ERROR: 1 +(module + (func + loop + end $foo)) +(;; STDERR ;;; +parse/expr/bad-loop-end-label.txt:5:9: unexpected label "$foo" + end $foo)) + ^^^^ +;;; STDERR ;;) diff --git a/test/parse/expr/bad-loop-mismatch-label.txt b/test/parse/expr/bad-loop-mismatch-label.txt new file mode 100644 index 00000000..cd4e7543 --- /dev/null +++ b/test/parse/expr/bad-loop-mismatch-label.txt @@ -0,0 +1,10 @@ +;;; ERROR: 1 +(module + (func + loop $foo + end $bar)) +(;; STDERR ;;; +parse/expr/bad-loop-mismatch-label.txt:5:9: mismatching label "$foo" != "$bar" + end $bar)) + ^^^^ +;;; STDERR ;;) diff --git a/test/parse/module/data-offset.txt b/test/parse/module/data-offset.txt index 8dae92f2..dfa6dad5 100644 --- a/test/parse/module/data-offset.txt +++ b/test/parse/module/data-offset.txt @@ -2,5 +2,4 @@ (import "foo" "bar" (global i32)) (memory 1) (global i32 i32.const 1) - (data (get_global 0) "hi") - (data (get_global 1) "world")) + (data (get_global 0) "hi")) diff --git a/test/parse/module/elem-offset.txt b/test/parse/module/elem-offset.txt index 269896e7..44721f8f 100644 --- a/test/parse/module/elem-offset.txt +++ b/test/parse/module/elem-offset.txt @@ -3,5 +3,4 @@ (global i32 i32.const 1) (func) (table 2 anyfunc) - (elem (get_global 0) 0) - (elem (get_global 1) 0)) + (elem (get_global 0) 0)) diff --git a/test/parse/module/global.txt b/test/parse/module/global.txt index b473f0a6..5a94ca96 100644 --- a/test/parse/module/global.txt +++ b/test/parse/module/global.txt @@ -1,4 +1,9 @@ (module + (import "foo" "i32_global" (global i32)) + (import "foo" "i64_global" (global i64)) + (import "foo" "f32_global" (global f32)) + (import "foo" "f64_global" (global f64)) + (global i32 (i32.const 1)) (global i64 (i64.const 2)) (global f32 (f32.const 3)) diff --git a/test/spec/binary.txt b/test/spec/binary.txt index ff374033..bd4caf41 100644 --- a/test/spec/binary.txt +++ b/test/spec/binary.txt @@ -14,29 +14,41 @@ assert_malformed error: (assert_malformed (module "\00as") "unexpected end") ^^^^^^ assert_malformed error: - third_party/testsuite/binary.wast:9:20: error in binary module: @0x00000000: unable to read uint32_t: magic -(assert_malformed (module "\01") "unexpected end") + third_party/testsuite/binary.wast:9:20: error in binary module: @0x00000004: bad magic value +(assert_malformed (module "asm\00") "magic header not detected") ^^^^^^ assert_malformed error: third_party/testsuite/binary.wast:10:20: error in binary module: @0x00000004: bad magic value -(assert_malformed (module "asm\00") "magic header not detected") +(assert_malformed (module "msa\00") "magic header not detected") + ^^^^^^ +assert_malformed error: + third_party/testsuite/binary.wast:11:20: error in binary module: @0x00000004: bad magic value +(assert_malformed (module "msa\00\0d\00\00\00") "magic header not detected") ^^^^^^ assert_malformed error: - third_party/testsuite/binary.wast:12:20: error in binary module: @0x00000004: unable to read uint32_t: version + third_party/testsuite/binary.wast:12:20: error in binary module: @0x00000004: bad magic value +(assert_malformed (module "msa\00\00\00\00\0d") "magic header not detected") + ^^^^^^ +assert_malformed error: + third_party/testsuite/binary.wast:14:20: error in binary module: @0x00000004: unable to read uint32_t: version (assert_malformed (module "\00asm") "unexpected end") ^^^^^^ assert_malformed error: - third_party/testsuite/binary.wast:13:20: error in binary module: @0x00000004: unable to read uint32_t: version + third_party/testsuite/binary.wast:15:20: error in binary module: @0x00000004: unable to read uint32_t: version (assert_malformed (module "\00asm\0d") "unexpected end") ^^^^^^ assert_malformed error: - third_party/testsuite/binary.wast:14:20: error in binary module: @0x00000004: unable to read uint32_t: version + third_party/testsuite/binary.wast:16:20: error in binary module: @0x00000004: unable to read uint32_t: version (assert_malformed (module "\00asm\0d\00\00") "unexpected end") ^^^^^^ assert_malformed error: - third_party/testsuite/binary.wast:15:20: error in binary module: @0x00000008: bad wasm file version: 0xe (expected 0xd) + third_party/testsuite/binary.wast:17:20: error in binary module: @0x00000008: bad wasm file version: 0xe (expected 0xd) (assert_malformed (module "\00asm\0e\00\00\00") "unknown binary version") ^^^^^^ +assert_malformed error: + third_party/testsuite/binary.wast:18:20: error in binary module: @0x00000008: bad wasm file version: 0xd000000 (expected 0xd) +(assert_malformed (module "\00asm\00\00\00\0d") "unknown binary version") + ^^^^^^ third_party/testsuite/binary.wast:6: assert_malformed passed: error: @0x00000000: unable to read uint32_t: magic third_party/testsuite/binary.wast:7: assert_malformed passed: @@ -44,16 +56,22 @@ third_party/testsuite/binary.wast:7: assert_malformed passed: third_party/testsuite/binary.wast:8: assert_malformed passed: error: @0x00000000: unable to read uint32_t: magic third_party/testsuite/binary.wast:9: assert_malformed passed: - error: @0x00000000: unable to read uint32_t: magic + error: @0x00000004: bad magic value third_party/testsuite/binary.wast:10: assert_malformed passed: error: @0x00000004: bad magic value +third_party/testsuite/binary.wast:11: assert_malformed passed: + error: @0x00000004: bad magic value third_party/testsuite/binary.wast:12: assert_malformed passed: - error: @0x00000004: unable to read uint32_t: version -third_party/testsuite/binary.wast:13: assert_malformed passed: - error: @0x00000004: unable to read uint32_t: version + error: @0x00000004: bad magic value third_party/testsuite/binary.wast:14: assert_malformed passed: error: @0x00000004: unable to read uint32_t: version third_party/testsuite/binary.wast:15: assert_malformed passed: + error: @0x00000004: unable to read uint32_t: version +third_party/testsuite/binary.wast:16: assert_malformed passed: + error: @0x00000004: unable to read uint32_t: version +third_party/testsuite/binary.wast:17: assert_malformed passed: error: @0x00000008: bad wasm file version: 0xe (expected 0xd) -9/9 tests passed. +third_party/testsuite/binary.wast:18: assert_malformed passed: + error: @0x00000008: bad wasm file version: 0xd000000 (expected 0xd) +12/12 tests passed. ;;; STDOUT ;;) diff --git a/test/spec/float_misc.txt b/test/spec/float_misc.txt index eecd3853..d63a2e96 100644 --- a/test/spec/float_misc.txt +++ b/test/spec/float_misc.txt @@ -1,5 +1,5 @@ ;;; TOOL: run-interp-spec ;;; STDIN_FILE: third_party/testsuite/float_misc.wast (;; STDOUT ;;; -425/425 tests passed. +417/417 tests passed. ;;; STDOUT ;;) diff --git a/test/spec/globals.txt b/test/spec/globals.txt index 5f0c9ecc..489dfb8d 100644 --- a/test/spec/globals.txt +++ b/test/spec/globals.txt @@ -34,11 +34,11 @@ assert_invalid error: (module (global i32 (f32.const 0))) ^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/globals.wast:90:11: initializer expression can only be reference a previously defined global + third_party/testsuite/globals.wast:90:11: initializer expression can only reference a previously defined global (module (global i32 (get_global 0))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/globals.wast:95:11: initializer expression can only be reference a previously defined global + third_party/testsuite/globals.wast:95:11: initializer expression can only reference a previously defined global (module (global i32 (get_global 1)) (global i32 (i32.const 0))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 16/16 tests passed. diff --git a/test/spec/imports.txt b/test/spec/imports.txt index ddddb243..55552b52 100644 --- a/test/spec/imports.txt +++ b/test/spec/imports.txt @@ -2,205 +2,206 @@ ;;; STDIN_FILE: third_party/testsuite/imports.wast (;; STDOUT ;;; assert_invalid error: - third_party/testsuite/imports.wast:270:45: only one table allowed + third_party/testsuite/imports.wast:284:45: only one table allowed (module (import "" "" (table 10 anyfunc)) (import "" "" (table 10 anyfunc))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/imports.wast:274:45: only one table allowed + third_party/testsuite/imports.wast:288:45: only one table allowed (module (import "" "" (table 10 anyfunc)) (table 10 anyfunc)) ^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/imports.wast:278:30: only one table allowed + third_party/testsuite/imports.wast:292:30: only one table allowed (module (table 10 anyfunc) (table 10 anyfunc)) ^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/imports.wast:365:37: only one memory block allowed + third_party/testsuite/imports.wast:379:37: only one memory block allowed (module (import "" "" (memory 1)) (import "" "" (memory 1))) ^^^^^^^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/imports.wast:369:37: only one memory block allowed + third_party/testsuite/imports.wast:383:37: only one memory block allowed (module (import "" "" (memory 1)) (memory 0)) ^^^^^^^^^^ assert_invalid error: - third_party/testsuite/imports.wast:373:22: only one memory block allowed + third_party/testsuite/imports.wast:387:22: only one memory block allowed (module (memory 0) (memory 0)) ^^^^^^^^^^ called host spectest.print(i32:13) => called host spectest.print(i32:14, f32:42) => called host spectest.print(i32:13) => called host spectest.print(i32:13) => +called host spectest.print(f32:13) => called host spectest.print(i32:13) => called host spectest.print(i64:24) => -called host spectest.print(i64:25, f64:53) => -called host spectest.print(i64:24) => -called host spectest.print(i64:24) => -called host spectest.print(i64:24) => -third_party/testsuite/imports.wast:72: assert_unlinkable passed: +called host spectest.print(f64:25, f64:53) => +called host spectest.print(f64:24) => +called host spectest.print(f64:24) => +called host spectest.print(f64:24) => +third_party/testsuite/imports.wast:86: assert_unlinkable passed: error: unknown module field "unknown" error: @0x0000001e: on_import callback failed -third_party/testsuite/imports.wast:76: assert_unlinkable passed: +third_party/testsuite/imports.wast:90: assert_unlinkable passed: error: unknown host function import "spectest.unknown" error: @0x00000024: on_import_func callback failed -third_party/testsuite/imports.wast:81: assert_unlinkable passed: +third_party/testsuite/imports.wast:95: assert_unlinkable passed: error: import signature mismatch error: @0x0000001e: on_import_func callback failed -third_party/testsuite/imports.wast:85: assert_unlinkable passed: +third_party/testsuite/imports.wast:99: assert_unlinkable passed: error: import signature mismatch error: @0x0000001e: on_import_func callback failed -third_party/testsuite/imports.wast:89: assert_unlinkable passed: +third_party/testsuite/imports.wast:103: assert_unlinkable passed: error: import signature mismatch error: @0x0000001f: on_import_func callback failed -third_party/testsuite/imports.wast:93: assert_unlinkable passed: +third_party/testsuite/imports.wast:107: assert_unlinkable passed: error: import signature mismatch error: @0x00000021: on_import_func callback failed -third_party/testsuite/imports.wast:97: assert_unlinkable passed: +third_party/testsuite/imports.wast:111: assert_unlinkable passed: error: import signature mismatch error: @0x00000022: on_import_func callback failed -third_party/testsuite/imports.wast:101: assert_unlinkable passed: +third_party/testsuite/imports.wast:115: assert_unlinkable passed: error: import signature mismatch error: @0x00000022: on_import_func callback failed -third_party/testsuite/imports.wast:105: assert_unlinkable passed: +third_party/testsuite/imports.wast:119: assert_unlinkable passed: error: import signature mismatch error: @0x00000022: on_import_func callback failed -third_party/testsuite/imports.wast:109: assert_unlinkable passed: +third_party/testsuite/imports.wast:123: assert_unlinkable passed: error: import signature mismatch error: @0x00000023: on_import_func callback failed -third_party/testsuite/imports.wast:113: assert_unlinkable passed: +third_party/testsuite/imports.wast:127: assert_unlinkable passed: error: import signature mismatch error: @0x00000022: on_import_func callback failed -third_party/testsuite/imports.wast:117: assert_unlinkable passed: +third_party/testsuite/imports.wast:131: assert_unlinkable passed: error: import signature mismatch error: @0x00000023: on_import_func callback failed -third_party/testsuite/imports.wast:121: assert_unlinkable passed: +third_party/testsuite/imports.wast:135: assert_unlinkable passed: error: import signature mismatch error: @0x00000023: on_import_func callback failed -third_party/testsuite/imports.wast:125: assert_unlinkable passed: +third_party/testsuite/imports.wast:139: assert_unlinkable passed: error: import signature mismatch error: @0x00000023: on_import_func callback failed -third_party/testsuite/imports.wast:129: assert_unlinkable passed: +third_party/testsuite/imports.wast:143: assert_unlinkable passed: error: import signature mismatch error: @0x00000024: on_import_func callback failed -third_party/testsuite/imports.wast:133: assert_unlinkable passed: +third_party/testsuite/imports.wast:147: assert_unlinkable passed: error: import signature mismatch error: @0x00000026: on_import_func callback failed -third_party/testsuite/imports.wast:137: assert_unlinkable passed: +third_party/testsuite/imports.wast:151: assert_unlinkable passed: error: import signature mismatch error: @0x00000027: on_import_func callback failed -third_party/testsuite/imports.wast:141: assert_unlinkable passed: +third_party/testsuite/imports.wast:155: assert_unlinkable passed: error: import signature mismatch error: @0x00000027: on_import_func callback failed -third_party/testsuite/imports.wast:146: assert_unlinkable passed: +third_party/testsuite/imports.wast:160: assert_unlinkable passed: error: expected import "test.global-i32" to have kind func, not global error: @0x00000024: on_import_func callback failed -third_party/testsuite/imports.wast:150: assert_unlinkable passed: +third_party/testsuite/imports.wast:164: assert_unlinkable passed: error: expected import "test.table-10-inf" to have kind func, not table error: @0x00000025: on_import_func callback failed -third_party/testsuite/imports.wast:154: assert_unlinkable passed: +third_party/testsuite/imports.wast:168: assert_unlinkable passed: error: expected import "test.memory-2-inf" to have kind func, not memory error: @0x00000025: on_import_func callback failed -third_party/testsuite/imports.wast:158: assert_unlinkable passed: +third_party/testsuite/imports.wast:172: assert_unlinkable passed: error: unknown host function import "spectest.global" error: @0x00000023: on_import_func callback failed -third_party/testsuite/imports.wast:162: assert_unlinkable passed: +third_party/testsuite/imports.wast:176: assert_unlinkable passed: error: unknown host function import "spectest.table" error: @0x00000022: on_import_func callback failed -third_party/testsuite/imports.wast:166: assert_unlinkable passed: +third_party/testsuite/imports.wast:180: assert_unlinkable passed: error: unknown host function import "spectest.memory" error: @0x00000023: on_import_func callback failed -third_party/testsuite/imports.wast:199: assert_unlinkable passed: +third_party/testsuite/imports.wast:213: assert_unlinkable passed: error: unknown module field "unknown" error: @0x00000018: on_import callback failed -third_party/testsuite/imports.wast:203: assert_unlinkable passed: +third_party/testsuite/imports.wast:217: assert_unlinkable passed: error: unknown host global import "spectest.unknown" error: @0x0000001f: on_import_global callback failed -third_party/testsuite/imports.wast:208: assert_unlinkable passed: +third_party/testsuite/imports.wast:222: assert_unlinkable passed: error: expected import "test.func" to have kind global, not func error: @0x00000018: on_import_global callback failed -third_party/testsuite/imports.wast:212: assert_unlinkable passed: +third_party/testsuite/imports.wast:226: assert_unlinkable passed: error: expected import "test.table-10-inf" to have kind global, not table error: @0x00000020: on_import_global callback failed -third_party/testsuite/imports.wast:216: assert_unlinkable passed: +third_party/testsuite/imports.wast:230: assert_unlinkable passed: error: expected import "test.memory-2-inf" to have kind global, not memory error: @0x00000020: on_import_global callback failed -third_party/testsuite/imports.wast:220: assert_unlinkable passed: +third_party/testsuite/imports.wast:234: assert_unlinkable passed: error: unknown host global import "spectest.print" error: @0x0000001d: on_import_global callback failed -third_party/testsuite/imports.wast:224: assert_unlinkable passed: +third_party/testsuite/imports.wast:238: assert_unlinkable passed: error: unknown host global import "spectest.table" error: @0x0000001d: on_import_global callback failed -third_party/testsuite/imports.wast:228: assert_unlinkable passed: +third_party/testsuite/imports.wast:242: assert_unlinkable passed: error: unknown host global import "spectest.memory" error: @0x0000001e: on_import_global callback failed -third_party/testsuite/imports.wast:295: assert_unlinkable passed: +third_party/testsuite/imports.wast:309: assert_unlinkable passed: error: unknown module field "unknown" error: @0x00000018: on_import callback failed -third_party/testsuite/imports.wast:299: assert_unlinkable passed: +third_party/testsuite/imports.wast:313: assert_unlinkable passed: error: unknown host table import "spectest.unknown" error: @0x00000020: on_import_table callback failed -third_party/testsuite/imports.wast:304: assert_unlinkable passed: +third_party/testsuite/imports.wast:318: assert_unlinkable passed: error: actual size (10) smaller than declared (12) error: @0x00000021: on_import_table callback failed -third_party/testsuite/imports.wast:308: assert_unlinkable passed: +third_party/testsuite/imports.wast:322: assert_unlinkable passed: error: max size (unspecified) larger than declared (20) error: @0x00000022: on_import_table callback failed -third_party/testsuite/imports.wast:312: assert_unlinkable passed: +third_party/testsuite/imports.wast:326: assert_unlinkable passed: error: actual size (10) smaller than declared (12) error: @0x0000001e: on_import_table callback failed -third_party/testsuite/imports.wast:316: assert_unlinkable passed: +third_party/testsuite/imports.wast:330: assert_unlinkable passed: error: max size (20) larger than declared (15) error: @0x0000001f: on_import_table callback failed -third_party/testsuite/imports.wast:321: assert_unlinkable passed: +third_party/testsuite/imports.wast:335: assert_unlinkable passed: error: expected import "test.func" to have kind table, not func error: @0x00000019: on_import_table callback failed -third_party/testsuite/imports.wast:325: assert_unlinkable passed: +third_party/testsuite/imports.wast:339: assert_unlinkable passed: error: expected import "test.global-i32" to have kind table, not global error: @0x0000001f: on_import_table callback failed -third_party/testsuite/imports.wast:329: assert_unlinkable passed: +third_party/testsuite/imports.wast:343: assert_unlinkable passed: error: expected import "test.memory-2-inf" to have kind table, not memory error: @0x00000021: on_import_table callback failed -third_party/testsuite/imports.wast:333: assert_unlinkable passed: +third_party/testsuite/imports.wast:347: assert_unlinkable passed: error: unknown host table import "spectest.print" error: @0x0000001e: on_import_table callback failed -third_party/testsuite/imports.wast:388: assert_unlinkable passed: +third_party/testsuite/imports.wast:402: assert_unlinkable passed: error: unknown module field "unknown" error: @0x00000018: on_import callback failed -third_party/testsuite/imports.wast:392: assert_unlinkable passed: +third_party/testsuite/imports.wast:406: assert_unlinkable passed: error: unknown host memory import "spectest.unknown" error: @0x0000001f: on_import_memory callback failed -third_party/testsuite/imports.wast:397: assert_unlinkable passed: +third_party/testsuite/imports.wast:411: assert_unlinkable passed: error: actual size (2) smaller than declared (3) error: @0x00000020: on_import_memory callback failed -third_party/testsuite/imports.wast:401: assert_unlinkable passed: +third_party/testsuite/imports.wast:415: assert_unlinkable passed: error: max size (unspecified) larger than declared (3) error: @0x00000021: on_import_memory callback failed -third_party/testsuite/imports.wast:405: assert_unlinkable passed: +third_party/testsuite/imports.wast:419: assert_unlinkable passed: error: actual size (1) smaller than declared (2) error: @0x0000001e: on_import_memory callback failed -third_party/testsuite/imports.wast:409: assert_unlinkable passed: +third_party/testsuite/imports.wast:423: assert_unlinkable passed: error: max size (2) larger than declared (1) error: @0x0000001f: on_import_memory callback failed -third_party/testsuite/imports.wast:414: assert_unlinkable passed: +third_party/testsuite/imports.wast:428: assert_unlinkable passed: error: expected import "test.func-i32" to have kind memory, not func error: @0x0000001c: on_import_memory callback failed -third_party/testsuite/imports.wast:418: assert_unlinkable passed: +third_party/testsuite/imports.wast:432: assert_unlinkable passed: error: expected import "test.global-i32" to have kind memory, not global error: @0x0000001e: on_import_memory callback failed -third_party/testsuite/imports.wast:422: assert_unlinkable passed: +third_party/testsuite/imports.wast:436: assert_unlinkable passed: error: expected import "test.table-10-inf" to have kind memory, not table error: @0x00000020: on_import_memory callback failed -third_party/testsuite/imports.wast:426: assert_unlinkable passed: +third_party/testsuite/imports.wast:440: assert_unlinkable passed: error: unknown host memory import "spectest.print" error: @0x0000001d: on_import_memory callback failed -third_party/testsuite/imports.wast:430: assert_unlinkable passed: +third_party/testsuite/imports.wast:444: assert_unlinkable passed: error: unknown host memory import "spectest.global" error: @0x0000001e: on_import_memory callback failed -third_party/testsuite/imports.wast:434: assert_unlinkable passed: +third_party/testsuite/imports.wast:448: assert_unlinkable passed: error: unknown host memory import "spectest.table" error: @0x0000001d: on_import_memory callback failed -third_party/testsuite/imports.wast:439: assert_unlinkable passed: +third_party/testsuite/imports.wast:453: assert_unlinkable passed: error: actual size (1) smaller than declared (2) error: @0x0000001e: on_import_memory callback failed -third_party/testsuite/imports.wast:443: assert_unlinkable passed: +third_party/testsuite/imports.wast:457: assert_unlinkable passed: error: max size (2) larger than declared (1) error: @0x0000001f: on_import_memory callback failed 85/85 tests passed. diff --git a/test/spec/memory.txt b/test/spec/memory.txt index b3f792e4..2fb2649d 100644 --- a/test/spec/memory.txt +++ b/test/spec/memory.txt @@ -2,133 +2,109 @@ ;;; STDIN_FILE: third_party/testsuite/memory.wast (;; STDOUT ;;; assert_invalid error: - third_party/testsuite/memory.wast:25:26: memory variable out of range (max 0) + third_party/testsuite/memory.wast:26:26: memory variable out of range (max 0) (assert_invalid (module (data (i32.const 0))) "unknown memory") ^^^^ assert_invalid error: - third_party/testsuite/memory.wast:26:26: memory variable out of range (max 0) + third_party/testsuite/memory.wast:27:26: memory variable out of range (max 0) (assert_invalid (module (data (i32.const 0) "")) "unknown memory") ^^^^ assert_invalid error: - third_party/testsuite/memory.wast:27:26: memory variable out of range (max 0) + third_party/testsuite/memory.wast:28:26: memory variable out of range (max 0) (assert_invalid (module (data (i32.const 0) "x")) "unknown memory") ^^^^ assert_invalid error: - third_party/testsuite/memory.wast:30:29: type mismatch at data segment offset. got i64, expected i32 + third_party/testsuite/memory.wast:31:29: type mismatch at data segment offset. got i64, expected i32 (module (memory 1) (data (i64.const 0))) ^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:34:22: invalid data segment offset, must be a constant expression; either *.const or get_global. + third_party/testsuite/memory.wast:35:22: invalid data segment offset, must be a constant expression; either *.const or get_global. (module (memory 1) (data (i32.ctz (i32.const 0)))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:38:22: invalid data segment offset, must be a constant expression; either *.const or get_global. + third_party/testsuite/memory.wast:39:22: invalid data segment offset, must be a constant expression; either *.const or get_global. (module (memory 1) (data (nop))) ^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:42:22: initializer expression cannot reference a mutable global - (module (memory 1) (data (get_global $g)) (global $g (mut i32) (i32.const 0))) - ^^^^^^^^^^^^^^^^^^^^^^ -assert_invalid error: - third_party/testsuite/memory.wast:74:11: max pages (0) must be >= initial pages (1) + third_party/testsuite/memory.wast:76:11: max pages (0) must be >= initial pages (1) (module (memory 1 0)) ^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:78:11: initial pages (65537) must be <= (65536) + third_party/testsuite/memory.wast:80:11: initial pages (65537) must be <= (65536) (module (memory 65537)) ^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:82:11: initial pages (2147483648) must be <= (65536) + third_party/testsuite/memory.wast:84:11: initial pages (2147483648) must be <= (65536) (module (memory 2147483648)) ^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:86:11: initial pages (4294967295) must be <= (65536) + third_party/testsuite/memory.wast:88:11: initial pages (4294967295) must be <= (65536) (module (memory 4294967295)) ^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:90:11: max pages (65537) must be <= (65536) + third_party/testsuite/memory.wast:92:11: max pages (65537) must be <= (65536) (module (memory 0 65537)) ^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:94:11: max pages (2147483648) must be <= (65536) + third_party/testsuite/memory.wast:96:11: max pages (2147483648) must be <= (65536) (module (memory 0 2147483648)) ^^^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:98:11: max pages (4294967295) must be <= (65536) + third_party/testsuite/memory.wast:100:11: max pages (4294967295) must be <= (65536) (module (memory 0 4294967295)) ^^^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:109:35: alignment must be power-of-two - (module (memory 0) (func (drop (i64.load align=0 (i32.const 0))))) - ^^^^^^^^^^^^^^^^ -assert_invalid error: - third_party/testsuite/memory.wast:113:35: alignment must be power-of-two - (module (memory 0) (func (drop (i64.load align=3 (i32.const 0))))) - ^^^^^^^^^^^^^^^^ -assert_invalid error: - third_party/testsuite/memory.wast:117:35: alignment must be power-of-two - (module (memory 0) (func (drop (i64.load align=5 (i32.const 0))))) - ^^^^^^^^^^^^^^^^ -assert_invalid error: - third_party/testsuite/memory.wast:121:35: alignment must be power-of-two - (module (memory 0) (func (drop (i64.load align=6 (i32.const 0))))) - ^^^^^^^^^^^^^^^^ -assert_invalid error: - third_party/testsuite/memory.wast:125:35: alignment must be power-of-two - (module (memory 0) (func (drop (i64.load align=7 (i32.const 0))))) - ^^^^^^^^^^^^^^^^ -assert_invalid error: - third_party/testsuite/memory.wast:130:35: alignment must not be larger than natural alignment (8) + third_party/testsuite/memory.wast:111:35: alignment must not be larger than natural alignment (8) (module (memory 0) (func (drop (i64.load align=16 (i32.const 0))))) ^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:134:35: alignment must not be larger than natural alignment (8) + third_party/testsuite/memory.wast:115:35: alignment must not be larger than natural alignment (8) (module (memory 0) (func (drop (i64.load align=32 (i32.const 0))))) ^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:138:35: alignment must not be larger than natural alignment (4) + third_party/testsuite/memory.wast:119:35: alignment must not be larger than natural alignment (4) (module (memory 0) (func (drop (i32.load align=8 (i32.const 0))))) ^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:142:35: alignment must not be larger than natural alignment (2) + third_party/testsuite/memory.wast:123:35: alignment must not be larger than natural alignment (2) (module (memory 0) (func (drop (i32.load16_u align=4 (i32.const 0))))) ^^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:146:35: alignment must not be larger than natural alignment (1) + third_party/testsuite/memory.wast:127:35: alignment must not be larger than natural alignment (1) (module (memory 0) (func (drop (i32.load8_u align=2 (i32.const 0))))) ^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:150:29: alignment must not be larger than natural alignment (1) + third_party/testsuite/memory.wast:131:29: alignment must not be larger than natural alignment (1) (module (memory 0) (func (i32.store8 align=2 (i32.const 0) (i32.const 0)))) ^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:154:29: alignment must not be larger than natural alignment (2) + third_party/testsuite/memory.wast:135:29: alignment must not be larger than natural alignment (2) (module (memory 0) (func (i32.load16_u align=4 (i32.const 0)))) ^^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:154:22: type stack at end of function is 1. expected 0 + third_party/testsuite/memory.wast:135:22: type stack at end of function is 1. expected 0 (module (memory 0) (func (i32.load16_u align=4 (i32.const 0)))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:158:29: alignment must not be larger than natural alignment (1) + third_party/testsuite/memory.wast:139:29: alignment must not be larger than natural alignment (1) (module (memory 0) (func (i32.load8_u align=2 (i32.const 0)))) ^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:158:22: type stack at end of function is 1. expected 0 + third_party/testsuite/memory.wast:139:22: type stack at end of function is 1. expected 0 (module (memory 0) (func (i32.load8_u align=2 (i32.const 0)))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assert_invalid error: - third_party/testsuite/memory.wast:162:29: alignment must not be larger than natural alignment (1) + third_party/testsuite/memory.wast:143:29: alignment must not be larger than natural alignment (1) (module (memory 0) (func (i32.store8 align=2 (i32.const 0) (i32.const 0)))) ^^^^^^^^^^^^^^^^^^ -third_party/testsuite/memory.wast:47: assert_unlinkable passed: +third_party/testsuite/memory.wast:49: assert_unlinkable passed: error: data segment is out of bounds: [0, 1) >= max value 0 error: @0x00000017: on_data_segment_data callback failed -third_party/testsuite/memory.wast:51: assert_unlinkable passed: +third_party/testsuite/memory.wast:53: assert_unlinkable passed: error: data segment is out of bounds: [98304, 98305) >= max value 65536 error: @0x0000001f: on_data_segment_data callback failed -third_party/testsuite/memory.wast:60: assert_unlinkable passed: - error: data segment is out of bounds: [65536, 65537) >= max value 65536 - error: @0x00000020: on_data_segment_data callback failed +third_party/testsuite/memory.wast:62: assert_unlinkable passed: + error: data segment is out of bounds: [666, 667) >= max value 0 + error: @0x0000002c: on_data_segment_data callback failed 30/30 tests passed. ;;; STDOUT ;;) diff --git a/test/typecheck/bad-global-getglobal-type-mismatch.txt b/test/typecheck/bad-global-getglobal-type-mismatch.txt index 08814f8b..5289d71d 100644 --- a/test/typecheck/bad-global-getglobal-type-mismatch.txt +++ b/test/typecheck/bad-global-getglobal-type-mismatch.txt @@ -1,6 +1,6 @@ ;;; ERROR: 1 (module - (global i32 (i32.const 1)) + (import "foo" "bar" (global i32)) (global f32 (get_global 0))) (;; STDERR ;;; typecheck/bad-global-getglobal-type-mismatch.txt:4:16: type mismatch at global initializer expression. got i32, expected f32 diff --git a/third_party/testsuite b/third_party/testsuite -Subproject 81107d5e270b8d35a5e2cfe8e2bb35f84af87f4 +Subproject f464936e89661aa425eb15546f2cce052e3f709 |