Change 31834 by [EMAIL PROTECTED] on 2007/09/09 22:27:38 ununit pos value warning identified the wrong variable name
Affected files ... ... //depot/perl/sv.c#1421 edit ... //depot/perl/t/lib/warnings/9uninit#15 edit Differences ... ==== //depot/perl/sv.c#1421 (text) ==== Index: perl/sv.c --- perl/sv.c#1420~31770~ 2007-08-31 02:07:51.000000000 -0700 +++ perl/sv.c 2007-09-09 15:27:38.000000000 -0700 @@ -12077,6 +12077,11 @@ match = 1; /* XS or custom code could trigger random warnings */ goto do_op; + case OP_POS: + /* def-ness of rval pos() is independent of the def-ness of its arg */ + if ( !(obase->op_flags & OPf_MOD)) + break; + case OP_SCHOMP: case OP_CHOMP: if (SvROK(PL_rs) && uninit_sv == SvRV(PL_rs)) ==== //depot/perl/t/lib/warnings/9uninit#15 (text) ==== Index: perl/t/lib/warnings/9uninit --- perl/t/lib/warnings/9uninit#14~29193~ 2006-11-02 09:07:00.000000000 -0800 +++ perl/t/lib/warnings/9uninit 2007-09-09 15:27:38.000000000 -0700 @@ -759,6 +759,22 @@ ######## use warnings 'uninitialized'; my ($m1); +our ($g1); + +$v = pos($m1) + 1; +$v = pos($g1) + 1; +$m1 = 0; +$g1 = ""; +$v = pos($m1) + 1; +$v = pos($g1) + 1; +EXPECT +Use of uninitialized value in addition (+) at - line 5. +Use of uninitialized value in addition (+) at - line 6. +Use of uninitialized value in addition (+) at - line 9. +Use of uninitialized value in addition (+) at - line 10. +######## +use warnings 'uninitialized'; +my ($m1); { my $x = "a" x $m1 } # NB LHS of repeat does not warn { my @x = ("a") x $m1 } End of Patch.