From: Rafael Garcia-Suarez Date: Tue, 15 Jan 2002 23:02:44 +0000 (+0100) Subject: (replaced by #14303) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b6f8df71d5e985ce8ae65d0fa6dad736bb651b45;p=p5sagit%2Fp5-mst-13.2.git (replaced by #14303) Subject: [PATCH] length of undefined $(digit) should warn Message-ID: <20020115230244.A31786@rafael> p4raw-id: //depot/perl@14302 --- diff --git a/mg.c b/mg.c index 49f8bc4..c7ebca3 100644 --- a/mg.c +++ b/mg.c @@ -458,6 +458,14 @@ Perl_magic_len(pTHX_ SV *sv, MAGIC *mg) Perl_croak(aTHX_ "panic: magic_len: %"IVdf, (IV)i); return i; } + else { + if (ckWARN(WARN_UNINITIALIZED)) + report_uninit(); + } + } + else { + if (ckWARN(WARN_UNINITIALIZED)) + report_uninit(); } return 0; case '+': diff --git a/t/lib/warnings/mg b/t/lib/warnings/mg index f224335..6c9e271 100644 --- a/t/lib/warnings/mg +++ b/t/lib/warnings/mg @@ -42,3 +42,10 @@ $|=1; $SIG{"INT"} = "fred"; kill "INT",$$; EXPECT +######## +# mg.c +use warnings 'uninitialized'; +'foo' =~ /(b)(a)(r)/; +length $3; +EXPECT +Use of uninitialized value in length at - line 4.