Change 22525 by [EMAIL PROTECTED] on 2004/03/18 14:13:16
make ~$x give warning is $x isn't initialised.
Also add test for uninitialised warning in & op.
Affected files ...
... //depot/perl/pp.c#407 edit
... //depot/perl/t/lib/warnings/sv#7 edit
Differences ...
==== //depot/perl/pp.c#407 (text) ====
Index: perl/pp.c
--- perl/pp.c#406~22517~ Wed Mar 17 09:58:44 2004
+++ perl/pp.c Thu Mar 18 06:13:16 2004
@@ -2377,6 +2377,7 @@
register I32 anum;
STRLEN len;
+ (void)SvPV_nomg(sv,len);
sv_setsv_nomg(TARG, sv);
tmps = (U8*)SvPV_force(TARG, len);
anum = len;
==== //depot/perl/t/lib/warnings/sv#7 (text) ====
Index: perl/t/lib/warnings/sv
--- perl/t/lib/warnings/sv#6~19752~ Thu Jun 12 13:49:25 2003
+++ perl/t/lib/warnings/sv Thu Mar 18 06:13:16 2004
@@ -112,6 +112,26 @@
########
# sv.c
use warnings 'uninitialized' ;
+my $Y = 1 ;
+my $x = 1 & $a[$Y] ;
+no warnings 'uninitialized' ;
+my $Y = 1 ;
+$x = 1 & $b[$Y] ;
+EXPECT
+Use of uninitialized value in bitwise and (&) at - line 4.
+########
+# sv.c
+use warnings 'uninitialized' ;
+my $Y = 1 ;
+my $x = ~$a[$Y] ;
+no warnings 'uninitialized' ;
+my $Y = 1 ;
+$x = ~$b[$Y] ;
+EXPECT
+Use of uninitialized value in 1's complement (~) at - line 4.
+########
+# sv.c
+use warnings 'uninitialized' ;
my $x *= 1 ; # d
no warnings 'uninitialized' ;
my $y *= 1 ; # d
End of Patch.