This takes the pessimistic approach of skipping it for any first argu-
ment that is not a plain non-magical PV, just in case there is a 'p'
or 'P' in the stringified form.
Otherwise it scans the PV for 'p' or 'P' and skips the folding if either
is present.
Then it falls through to the usual op-filtering logic.
I nearly made ‘pack;’ crash, so I added a test to bproto.t.
if (IN_LOCALE_COMPILETIME)
goto nope;
break;
+ case OP_PACK:
+ if (!cLISTOPo->op_first->op_sibling
+ || cLISTOPo->op_first->op_sibling->op_type != OP_CONST)
+ goto nope;
+ {
+ SV * const sv = cSVOPx_sv(cLISTOPo->op_first->op_sibling);
+ if (!SvPOK(sv) || SvGMAGICAL(sv)) goto nope;
+ {
+ const char *s = SvPVX_const(sv);
+ while (s < SvEND(sv)) {
+ if (*s == 'p' || *s == 'P') goto nope;
+ s++;
+ }
+ }
+ }
+ break;
case OP_REPEAT:
if (o->op_private & OPpREPEAT_DOLIST) goto nope;
}
0x00024401, /* hslice */
0x00004b00, /* boolkeys */
0x00091480, /* unpack */
- 0x0002140d, /* pack */
+ 0x0002140f, /* pack */
0x00111408, /* split */
0x0002140d, /* join */
0x00002401, /* list */
# Explosives and implosives.
unpack unpack ck_fun u@ S S?
-pack pack ck_fun mst@ S L
+pack pack ck_fun fmst@ S L
split split ck_split t@ S S S
join join or string ck_join mst@ S L
@INC = '../lib';
}
-print "1..15\n";
+print "1..16\n";
my $i = 1;
test_too_few($_) for split /\n/,
q[ unpack;
+ pack;
];
test_no_error($_) for split /\n/,