summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2008-03-20 13:06:47 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-03-20 15:55:19 +0000
commit4052d21cf21adbbdc9b825b0bd88d7c5804670eb (patch)
tree0b5469fda124d8c9433507fd54958688993969b2
parentc762d24b2c953a47d439fb0fc6f1b9966169fe00 (diff)
downloadperl-4052d21cf21adbbdc9b825b0bd88d7c5804670eb.tar.gz
Double warning with perl -we '\&$x'
From: "Vincent Pit" <perl@profvince.com> Message-ID: <38561.147.210.17.175.1206011207.squirrel@147.210.17.175> p4raw-id: //depot/perl@33544
-rw-r--r--sv.c2
-rw-r--r--t/lib/warnings/9uninit2
2 files changed, 1 insertions, 3 deletions
diff --git a/sv.c b/sv.c
index 4d7f32d6eb..603cb3b114 100644
--- a/sv.c
+++ b/sv.c
@@ -7910,7 +7910,7 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **const st, GV **const gvp, const I32 lref)
LEAVE;
if (!GvCVu(gv))
Perl_croak(aTHX_ "Unable to create sub named \"%"SVf"\"",
- SVfARG(sv));
+ SVfARG(SvOK(sv) ? sv : &PL_sv_no));
}
return GvCVu(gv);
}
diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit
index bbaba19a0f..9316dc8515 100644
--- a/t/lib/warnings/9uninit
+++ b/t/lib/warnings/9uninit
@@ -1070,8 +1070,6 @@ reset $m1;
reset $g1;
EXPECT
Use of uninitialized value $m1 in subroutine dereference at - line 5.
-Use of uninitialized value $m1 in subroutine dereference at - line 5.
-Use of uninitialized value $g1 in subroutine dereference at - line 6.
Use of uninitialized value $g1 in subroutine dereference at - line 6.
Use of uninitialized value $m1 in splice at - line 9.
Use of uninitialized value $g1 in splice at - line 9.