diff options
author | Vincent Pit <perl@profvince.com> | 2010-01-06 19:13:27 +0100 |
---|---|---|
committer | Vincent Pit <perl@profvince.com> | 2010-01-06 19:21:13 +0100 |
commit | 06fc68671f70339bdc6ddf5b7367ae9db8b4cd2a (patch) | |
tree | 9c2d08582a407409cbbdc025224d79279238292d /dist | |
parent | bb1773de14d1367a85531986b90d3ce2d9da9dcb (diff) | |
download | perl-06fc68671f70339bdc6ddf5b7367ae9db8b4cd2a.tar.gz |
[perl #71870] Use of uninitialized value in bitwise and B::Deparse
It's better to just silence it in Deparse rather than stopping
B::PMOP::reflags from returning undef because of a non-constant regexp.
That way, we keep the possibility to test for this situation, and it stays
in line with B::PMOP::pregcomp.
Also bump $B::Deparse::VERSION.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/B-Deparse/Deparse.pm | 5 | ||||
-rw-r--r-- | dist/B-Deparse/t/deparse.t | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm index 93e250fd56..7c82c3ad4e 100644 --- a/dist/B-Deparse/Deparse.pm +++ b/dist/B-Deparse/Deparse.pm @@ -23,7 +23,7 @@ use B qw(class main_root main_start main_cv svref_2object opnumber perlstring PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED), ($] < 5.009 ? 'PMf_SKIPWHITE' : 'RXf_SKIPWHITE'), ($] < 5.011 ? 'CVf_LOCKED' : ()); -$VERSION = 0.93; +$VERSION = 0.94; use strict; use vars qw/$AUTOLOAD/; use warnings (); @@ -4311,10 +4311,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 $kid = $op->first; if ( $kid->flags & OPf_SPECIAL and ( $] < 5.009 ? $kid->pmflags & PMf_SKIPWHITE() - : $kid->reflags & RXf_SKIPWHITE() ) ) { + : ($kid->reflags || 0) & RXf_SKIPWHITE() ) ) { $exprs[0] = "' '"; } diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index 191324a7c3..0404ab35f5 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -17,7 +17,7 @@ BEGIN { require feature; feature->import(':5.10'); } -use Test::More tests => 83; +use Test::More tests => 84; use Config (); use B::Deparse; @@ -615,3 +615,9 @@ my @b; @a = reverse @a; @b = reverse @b; (); +#### +my($r, $s, @a); +@a = split(/foo/, $s, 0); +$r = qr/foo/; +@a = split(/$r/, $s, 0); +(); |