From 3207fc6be298e308e8094e866ca339ba7e9a2790 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 4 Aug 2012 10:16:01 -0700 Subject: [PATCH] sv.c:varname: Fix bad assertion added by c6fb3f6e #!perl -w my $x; format = @ "$x"; . write; __END__ Assertion failed: (!cv || SvTYPE(cv) == SVt_PVCV), function Perl_varname, file sv.c, line 13924. Abort trap --- sv.c | 2 +- t/lib/warnings/9uninit | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sv.c b/sv.c index 4ad53cd..dd4f19a 100644 --- a/sv.c +++ b/sv.c @@ -13921,7 +13921,7 @@ Perl_varname(pTHX_ const GV *const gv, const char gvtype, PADOFFSET targ, SV *sv; AV *av; - assert(!cv || SvTYPE(cv) == SVt_PVCV); + assert(!cv || SvTYPE(cv) == SVt_PVCV || SvTYPE(cv) == SVt_PVFM); if (!cv || !CvPADLIST(cv)) return NULL; diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit index 4068fab..717e7f6 100644 --- a/t/lib/warnings/9uninit +++ b/t/lib/warnings/9uninit @@ -2034,3 +2034,15 @@ use warnings 'uninitialized'; "@{[ $x ]}"; EXPECT Use of uninitialized value in join or string at - line 3. +######## +# inside formats +use warnings 'uninitialized'; +my $x; +format = +@ +"$x"; +. +write; +EXPECT +Use of uninitialized value $x in string at - line 6. + -- 2.7.4