diff options
author | David Mitchell <davem@iabyn.com> | 2019-04-05 12:49:50 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-04-05 14:02:09 +0100 |
commit | 017192018b7f9fc4b889bb344bd75df8f6b78929 (patch) | |
tree | c7c3f0039797e09b8571be51a39dcb3ace30e0a0 /perly.tab | |
parent | 2b902307c53477ab56cb732ac14b1e3371aed097 (diff) | |
download | perl-017192018b7f9fc4b889bb344bd75df8f6b78929.tar.gz |
parser: change LABEL type from pval to opval
The items pushed onto the parser stack can be one of several types:
ival, opval, pval etc. The only remaining use of pval is when a "label:"
is encountered.
When an error occurs during parsing, ops on the parse stack get
automatically reaped these days as part of the OP slab mechanism;
but bare strings (pvals) still leak.
Convert this one remaining pval into an opval, making the toker return
an OP_CONST with an SV holding the label.
Since newSTATEOP() still expects a raw string for the label, the parser
just grabs the value returned by the toker and makes a copy of the
string from it, then immediately frees the OP_CONST and its associated
SV.
The leak was showing up in ext/XS-APItest/t/stmtasexpr.t, which expects
to parse a statement where labels are banned.
Diffstat (limited to 'perly.tab')
-rw-r--r-- | perly.tab | 58 |
1 files changed, 29 insertions, 29 deletions
@@ -71,32 +71,32 @@ static const yytype_uint16 yyrline[] = { 0, 119, 119, 118, 130, 129, 140, 139, 153, 152, 166, 165, 179, 178, 191, 199, 207, 211, 219, 225, - 226, 236, 237, 246, 250, 254, 258, 265, 267, 280, - 277, 301, 296, 317, 325, 324, 333, 339, 345, 350, - 352, 354, 361, 369, 371, 368, 388, 393, 400, 399, - 414, 422, 428, 435, 434, 449, 453, 458, 466, 484, - 485, 490, 492, 494, 496, 498, 500, 502, 505, 511, - 512, 517, 528, 529, 535, 541, 542, 547, 550, 554, - 559, 563, 567, 568, 572, 578, 583, 588, 589, 594, - 595, 600, 601, 603, 608, 610, 622, 623, 628, 630, - 634, 654, 655, 657, 663, 728, 730, 736, 738, 742, - 748, 749, 754, 755, 760, 759, 818, 819, 824, 835, - 836, 839, 850, 852, 854, 856, 860, 862, 867, 871, - 875, 879, 885, 890, 896, 902, 904, 907, 906, 917, - 918, 922, 926, 929, 934, 939, 942, 946, 950, 956, - 964, 971, 977, 979, 981, 986, 988, 990, 995, 997, - 999, 1001, 1003, 1005, 1007, 1009, 1011, 1013, 1015, 1020, - 1022, 1025, 1027, 1029, 1032, 1035, 1046, 1049, 1056, 1058, - 1060, 1062, 1064, 1067, 1073, 1075, 1079, 1080, 1081, 1082, - 1083, 1085, 1087, 1089, 1091, 1093, 1095, 1097, 1099, 1101, - 1103, 1105, 1107, 1109, 1111, 1121, 1131, 1141, 1151, 1153, - 1155, 1158, 1163, 1167, 1169, 1171, 1173, 1176, 1178, 1181, - 1183, 1185, 1187, 1189, 1191, 1193, 1195, 1197, 1200, 1202, - 1204, 1206, 1208, 1210, 1214, 1217, 1216, 1229, 1230, 1231, - 1235, 1237, 1239, 1244, 1246, 1249, 1251, 1253, 1258, 1260, - 1265, 1266, 1271, 1272, 1278, 1282, 1283, 1284, 1287, 1288, - 1291, 1292, 1295, 1299, 1303, 1309, 1315, 1317, 1321, 1325, - 1326, 1330, 1331, 1335, 1336, 1341, 1343, 1345, 1348 + 226, 236, 237, 246, 250, 254, 261, 271, 273, 286, + 283, 307, 302, 323, 331, 330, 339, 345, 351, 356, + 358, 360, 367, 375, 377, 374, 394, 399, 406, 405, + 420, 428, 434, 441, 440, 455, 459, 464, 472, 490, + 491, 496, 498, 500, 502, 504, 506, 508, 511, 517, + 518, 523, 534, 535, 541, 547, 548, 553, 556, 560, + 565, 569, 573, 574, 578, 584, 589, 594, 595, 600, + 601, 606, 607, 609, 614, 616, 628, 629, 634, 636, + 640, 660, 661, 663, 669, 734, 736, 742, 744, 748, + 754, 755, 760, 761, 766, 765, 824, 825, 830, 841, + 842, 845, 856, 858, 860, 862, 866, 868, 873, 877, + 881, 885, 891, 896, 902, 908, 910, 913, 912, 923, + 924, 928, 932, 935, 940, 945, 948, 952, 956, 962, + 970, 977, 983, 985, 987, 992, 994, 996, 1001, 1003, + 1005, 1007, 1009, 1011, 1013, 1015, 1017, 1019, 1021, 1026, + 1028, 1031, 1033, 1035, 1038, 1041, 1052, 1055, 1062, 1064, + 1066, 1068, 1070, 1073, 1079, 1081, 1085, 1086, 1087, 1088, + 1089, 1091, 1093, 1095, 1097, 1099, 1101, 1103, 1105, 1107, + 1109, 1111, 1113, 1115, 1117, 1127, 1137, 1147, 1157, 1159, + 1161, 1164, 1169, 1173, 1175, 1177, 1179, 1182, 1184, 1187, + 1189, 1191, 1193, 1195, 1197, 1199, 1201, 1203, 1206, 1208, + 1210, 1212, 1214, 1216, 1220, 1223, 1222, 1235, 1236, 1237, + 1241, 1243, 1245, 1250, 1252, 1255, 1257, 1259, 1264, 1266, + 1271, 1272, 1277, 1278, 1284, 1288, 1289, 1290, 1293, 1294, + 1297, 1298, 1301, 1305, 1309, 1315, 1321, 1323, 1327, 1331, + 1332, 1336, 1337, 1341, 1342, 1347, 1349, 1351, 1354 }; #endif @@ -1091,7 +1091,7 @@ static const yytype_uint8 yyr2[] = }; typedef enum { - toketype_ival, toketype_opval, toketype_pval + toketype_ival, toketype_opval } toketypes; /* type of each token/terminal */ @@ -1102,7 +1102,7 @@ static const toketypes yy_type_tab[] = toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, - toketype_pval, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, + toketype_opval, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, @@ -1130,6 +1130,6 @@ static const toketypes yy_type_tab[] = }; /* Generated from: - * ac323bb6f3cacf4eb8eda6403a58c41f30954d07a4a6d6f7f00de81577b2c79a perly.y + * 7aa97cfabf5b87a95ed263373e76c7af6d7e075e83d12e84ccdca9690c15a68d perly.y * b6fae5748f9bef6db4740aa5e122b84ac5181852d42474d0ecad621fa4253306 regen_perly.pl * ex: set ro: */ |