summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-01-16 00:02:44 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-16 13:47:58 +0000
commitb6f8df71d5e985ce8ae65d0fa6dad736bb651b45 (patch)
treef0d36f7ace674df8309de3319ac8dde7558b61eb
parent85c35b1b6aace17a25d05e6009c8d812ced18c44 (diff)
downloadperl-b6f8df71d5e985ce8ae65d0fa6dad736bb651b45.tar.gz
(replaced by #14303)
Subject: [PATCH] length of undefined $(digit) should warn Message-ID: <20020115230244.A31786@rafael> p4raw-id: //depot/perl@14302
-rw-r--r--mg.c8
-rw-r--r--t/lib/warnings/mg7
2 files changed, 15 insertions, 0 deletions
diff --git a/mg.c b/mg.c
index 49f8bc413c..c7ebca3817 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 f2243357b3..6c9e271017 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.