Adrian M. Enache [Sun, 20 Apr 2003 02:45:48 +0000 (05:45 +0300)]
Subject: Re: [perl #21347] segfault in UNIVERSAL::AUTOLOAD
Date: Sun, 20 Apr 2003 02:45:48 +0300
Message-ID: <
20030419234548.GA849@ratsnest.hole>
and
Date: Wed, 2 Apr 2003 07:52:28 +0300
Message-ID: <
20030402045227.GA1023@ratsnest.hole>
p4raw-id: //depot/perl@19300
tmpsv = TOPs;
}
tmps = SvPV(tmpsv, len);
- if (!tmps || !len) {
+ if ((!tmps || !len) && PL_errgv) {
SV *error = ERRSV;
(void)SvUPGRADE(error, SVt_PV);
if (SvPOK(error) && SvCUR(error))
@INC = qw(. ../lib);
}
-print "1..66\n";
+print "1..67\n";
require 'test.pl';
if ($? != 0) { print "not " };
print "ok ",++$test," - UNIVERSAL::AUTOLOAD called when freeing qr//\n";
+runperl(prog => 'sub UNIVERSAL::DESTROY { warn } bless \$a, A', stderr => 1);
+if ($? != 0) { print "not " };
+print "ok ",++$test," - warn called inside UNIVERSAL::DESTROY\n";
+
# test global destruction
++$test;
}
/* if STDERR is tied, use it instead */
- if (PL_stderrgv && (io = GvIOp(PL_stderrgv))
+ if (PL_stderrgv && SvREFCNT(PL_stderrgv) && (io = GvIO(PL_stderrgv))
&& (mg = SvTIED_mg((SV*)io, PERL_MAGIC_tiedscalar))) {
dSP; ENTER;
PUSHMARK(SP);