diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-04 10:16:01 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-04 15:56:22 -0700 |
commit | 3207fc6be298e308e8094e866ca339ba7e9a2790 (patch) | |
tree | e3874cdfca9626a02f9b08cd19bf603e39345355 | |
parent | 5ceaabe8e4e93dd375a9f43ffc52956b89ed492d (diff) | |
download | perl-3207fc6be298e308e8094e866ca339ba7e9a2790.tar.gz |
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
-rw-r--r-- | sv.c | 2 | ||||
-rw-r--r-- | t/lib/warnings/9uninit | 12 |
2 files changed, 13 insertions, 1 deletions
@@ -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 4068fabcce..717e7f6fb0 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. + |