summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-11-06 01:35:38 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-11-06 02:10:04 -0800
commit52a6327bb1a7bdbfce3ca5a5bdd9de4531dbaf69 (patch)
tree8791e2cf0e9c6977adc24b429c230d10da925552 /pp.c
parenta4a3cf7419a4f30455db08fefe2cac688567ac22 (diff)
downloadperl-52a6327bb1a7bdbfce3ca5a5bdd9de4531dbaf69.tar.gz
[perl #96326] *{$io} should not be semi-defined
gv_efullname4 produces undef if the GV points to no stash, instead of using __ANON__, as it does when the stash has no name. Instead of going through hoops to try and work around it elsewhere, fix gv_efullname4. This means that $x = *$io; $x .= "whate’er"; no longer produces an uninitialized warning. (The warning was rather strange, as defined() returned true.) This commit also gives the glob the name $__ANONIO__ (yes, with a dol- lar sign). It may seem a little strange, but there is precedent in other autovivified globs, such as those open() produces when it cannot determine the variable name (e.g, open $t->{fh}).
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 7114f89bdb..5d5b6aee58 100644
--- a/pp.c
+++ b/pp.c
@@ -165,7 +165,7 @@ S_rv2gv(pTHX_ SV *sv, const bool vivify_sv, const bool strict,
sv = SvRV(sv);
if (SvTYPE(sv) == SVt_PVIO) {
GV * const gv = MUTABLE_GV(sv_newmortal());
- gv_init(gv, 0, "", 0, 0);
+ gv_init(gv, 0, "$__ANONIO__", 11, 0);
GvIOp(gv) = MUTABLE_IO(sv);
SvREFCNT_inc_void_NN(sv);
sv = MUTABLE_SV(gv);