summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorDevin Heitmueller <devin.heitmueller@gmail.com>2007-02-20 08:38:20 -0800
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-02-25 16:44:52 +0000
commit191f87d57c0c1de37eade12374d34b5d6bd6302a (patch)
treeed272455fcab6641241005e930af5e8ad0ffd6bd /util.c
parent4f8a7904197dd025b819b8286e290f52246539b7 (diff)
downloadperl-191f87d57c0c1de37eade12374d34b5d6bd6302a.tar.gz
[perl #41560] [PATCH] crash in Perl_vmess when GvIOp is null
From: "Devin Heitmueller" (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.6.HEAD-24617-1172018300-131.41560-75-0@perl.org> p4raw-id: //depot/perl@30398
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util.c b/util.c
index 3c5518339e..c2870ea3fa 100644
--- a/util.c
+++ b/util.c
@@ -1154,7 +1154,10 @@ Perl_vmess(pTHX_ const char *pat, va_list *args)
if (CopLINE(cop))
Perl_sv_catpvf(aTHX_ sv, " at %s line %"IVdf,
OutCopFILE(cop), (IV)CopLINE(cop));
- if (GvIO(PL_last_in_gv) && IoLINES(GvIOp(PL_last_in_gv))) {
+ /* Seems that GvIO() can be untrustworthy during global destruction. */
+ if (GvIO(PL_last_in_gv) && (SvTYPE(GvIOp(PL_last_in_gv)) == SVt_PVIO)
+ && IoLINES(GvIOp(PL_last_in_gv)))
+ {
const bool line_mode = (RsSIMPLE(PL_rs) &&
SvCUR(PL_rs) == 1 && *SvPVX_const(PL_rs) == '\n');
Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %"IVdf,