summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-26 18:18:16 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-26 18:18:16 +0000
commitf0d430785f65109b00384bce73f531f45cb6187b (patch)
treec3d7c49dbc8a0c78be93eefc8b314eacf815262c /pp_hot.c
parent30168b04c3ba9bfb3a1fc4685e8e8d51ebd3e3f4 (diff)
downloadperl-f0d430785f65109b00384bce73f531f45cb6187b.tar.gz
allow $fh->autoflush on globrefs, and thence autovivified filehandles
(from Tom Christiansen) p4raw-id: //depot/perl@5276
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 6027766e2f..b1bbbc7cab 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2757,9 +2757,13 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
*(PL_stack_base + TOPMARK + 1) = sv_2mortal(newRV((SV*)iogv));
}
- if (!ob || !SvOBJECT(ob))
+ if (!ob || !(SvOBJECT(ob)
+ || (SvTYPE(ob) == SVt_PVGV && (ob = (SV*)GvIO((GV*)ob))
+ && SvOBJECT(ob))))
+ {
Perl_croak(aTHX_ "Can't call method \"%s\" on unblessed reference",
name);
+ }
stash = SvSTASH(ob);