This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #113470] Constant folding for pack
authorFather Chrysostomos <sprout@cpan.org>
Sat, 14 Jul 2012 01:10:38 +0000 (18:10 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 14 Jul 2012 01:10:38 +0000 (18:10 -0700)
commitdd9a6ccfcb1b5e26680c14c1663ea9fac4480690
tree71ed0d182d35ceed4cb2007b0366b3d867fd08bf
parentc75cfcf022bbc2d851c911d5a33a70983d4ede48
[perl #113470] Constant folding for pack

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.
op.c
opcode.h
regen/opcodes
t/comp/bproto.t