From: Vincent Pit Date: Wed, 6 Jan 2010 18:13:27 +0000 (+0100) Subject: [perl #71870] Use of uninitialized value in bitwise and B::Deparse X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=06fc68671f70339bdc6ddf5b7367ae9db8b4cd2a;p=p5sagit%2Fp5-mst-13.2.git [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. --- diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm index 93e250f..7c82c3a 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 191324a..0404ab3 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); +();