summaryrefslogtreecommitdiff
path: root/dist/B-Deparse
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-09-22 17:54:12 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-09-22 18:50:50 -0700
commit5255171e6cd0accee6f76ea2980e32b3b5b8e171 (patch)
treef198188a949f401983d4493ed514365d2c09213c /dist/B-Deparse
parentd8e299374017857bcc055c31b6d4a808fb862100 (diff)
downloadperl-5255171e6cd0accee6f76ea2980e32b3b5b8e171.tar.gz
[perl #94490] const fold should not trigger special split " "
The easiest way to fix this was to move the special handling out of the regexp engine. Now a flag is set on the split op itself for this case. A real regexp is still created, as that is the most convenient way to propagate locale settings, and it prevents the need to rework pp_split to handle a null regexp. This also means that custom regexp plugins no longer need to handle split specially (which they all do currently).
Diffstat (limited to 'dist/B-Deparse')
-rw-r--r--dist/B-Deparse/Deparse.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm
index fd351409db..42f2645bcc 100644
--- a/dist/B-Deparse/Deparse.pm
+++ b/dist/B-Deparse/Deparse.pm
@@ -4657,8 +4657,11 @@ sub pp_split {
# handle special case of split(), and split(' ') that compiles to /\s+/
# Under 5.10, the reflags may be undef if the split regexp isn't a constant
+ # Under 5.17.5+, the special flag is on split itself.
$kid = $op->first;
- if ( $kid->flags & OPf_SPECIAL
+ if ( $op->flags & OPf_SPECIAL
+ or
+ $kid->flags & OPf_SPECIAL
and ( $] < 5.009 ? $kid->pmflags & PMf_SKIPWHITE()
: ($kid->reflags || 0) & RXf_SKIPWHITE() ) ) {
$exprs[0] = "' '";