From: Dave Mitchell Date: Fri, 7 May 2004 19:12:29 +0000 (+0000) Subject: symbolic references like ${"foo$index"}*3 would incorrectly warn X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e21bd3825ed9fd5714cb602cd09ae0057d5cdddf;p=p5sagit%2Fp5-mst-13.2.git symbolic references like ${"foo$index"}*3 would incorrectly warn that $index was the uninitialized value, when in fact it was $foo1 p4raw-id: //depot/perl@22802 --- diff --git a/sv.c b/sv.c index 9972817..10d768f 100644 --- a/sv.c +++ b/sv.c @@ -1000,6 +1000,7 @@ S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match) goto do_op2; + case OP_RV2SV: case OP_CUSTOM: case OP_ENTERSUB: match = 1; /* XS or custom code could trigger random warnings */ diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit index 0c8a8d9..b8ff2fa 100644 --- a/t/lib/warnings/9uninit +++ b/t/lib/warnings/9uninit @@ -311,6 +311,10 @@ $v = @$m1; $v = @$g1; $v = %$m2; $v = %$g2; + +$v = ${"foo.bar"}+1; +$v = ${"foo$m1"}+1; +$v = ${"foo$g1"}+1; EXPECT Use of uninitialized value $m1 in scalar dereference at - line 5. Use of uninitialized value $g1 in scalar dereference at - line 6. @@ -318,6 +322,11 @@ Use of uninitialized value $m1 in array dereference at - line 8. Use of uninitialized value $g1 in array dereference at - line 9. Use of uninitialized value $m2 in hash dereference at - line 10. Use of uninitialized value $g2 in hash dereference at - line 11. +Use of uninitialized value in addition (+) at - line 13. +Use of uninitialized value $m1 in concatenation (.) or string at - line 14. +Use of uninitialized value in addition (+) at - line 14. +Use of uninitialized value $g1 in concatenation (.) or string at - line 15. +Use of uninitialized value in addition (+) at - line 15. ######## use warnings 'uninitialized'; my ($m1, $v);