summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDaniel Chetlin <daniel@chetlin.com>2000-10-02 07:53:27 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2000-10-02 23:32:38 +0000
commit01bb7c6d67bc951562ed98068eba189cadd42374 (patch)
tree8a690ec57aeca12f1e60a5d90b22f5efaa807a7d /pp_hot.c
parentb38af7adab46822ec7c92d231d7fbb058dc22c4c (diff)
downloadperl-01bb7c6d67bc951562ed98068eba189cadd42374.tar.gz
Fix aliasing of tied filehandles
Message-ID: <20001002145327.C1617@ilmd> p4raw-id: //depot/perl@7110
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 17710d5e4f..7d395141e8 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -377,6 +377,7 @@ PP(pp_print)
else
gv = PL_defoutgv;
if ((mg = SvTIED_mg((SV*)gv, 'q'))) {
+ had_magic:
if (MARK == ORIGMARK) {
/* If using default handle then we need to make space to
* pass object as 1st arg, so move other args up ...
@@ -400,6 +401,8 @@ PP(pp_print)
}
if (!(io = GvIO(gv))) {
dTHR;
+ if ((GvEGV(gv)) && (mg = SvTIED_mg((SV*)GvEGV(gv),'q')))
+ goto had_magic;
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
SETERRNO(EBADF,RMS$_IFI);