From: Abhijit Menon-Sen Date: Thu, 25 Apr 2002 19:43:06 +0000 (+0000) Subject: $fh->close(); print $fh "foo" would segfault under -w in X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9453426ea2cb2131d06e23614e5610b999172c9d;p=p5sagit%2Fp5-mst-13.2.git $fh->close(); print $fh "foo" would segfault under -w in report_evil_fh() because $fh doesn't have a name. p4raw-id: //depot/perl@16166 --- diff --git a/util.c b/util.c index 6b95a4d..1c40d46 100644 --- a/util.c +++ b/util.c @@ -3447,7 +3447,8 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op) if (gv && isGV(gv)) { SV *sv = sv_newmortal(); gv_efullname4(sv, gv, Nullch, FALSE); - name = SvPVX(sv); + if (SvOK(sv)) + name = SvPVX(sv); } if (op == OP_phoney_OUTPUT_ONLY || op == OP_phoney_INPUT_ONLY) {