summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-09-20 22:14:23 +0100
committerDavid Mitchell <davem@iabyn.com>2010-09-20 22:14:23 +0100
commit68b590d93559da1f7a0d3956202180d507013365 (patch)
tree9dc4837a540d2ecf0644565a2a73ad2cb9e0d584 /pp_hot.c
parente4487e9b537f1be1e95aba1c87790c2a411788a7 (diff)
downloadperl-68b590d93559da1f7a0d3956202180d507013365.tar.gz
call defout/stderr destructors last
When calling the destructors for IO objects embedded in arena GVs, process PL_defoutgv and PL_stderrgv last. Yes, the test suite expects STDOUT to still work at this point. Indeed, one test in ref.t calls print from STDOUT's destructor (which is why pp_print needed a slight tweak to handle a null GV properly).
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 031c2cf707..4f043fb5f7 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -751,7 +751,7 @@ PP(pp_print)
RETURN;
}
if (!(io = GvIO(gv))) {
- if ((GvEGVx(gv)) && (io = GvIO(GvEGV(gv)))
+ if ( gv && GvEGVx(gv) && (io = GvIO(GvEGV(gv)))
&& (mg = SvTIED_mg((const SV *)io, PERL_MAGIC_tiedscalar)))
goto had_magic;
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))