Adrian M. Enache [Wed, 2 Apr 2003 05:02:42 +0000 (08:02 +0300)]
by adding a dummy destructor method Regexp::DESTROY.
This prevents infinite recursion, since Regexp::DESTROY
is no more autoloaded.
Subject: Re: [perl #21347] segfault in UNIVERSAL::AUTOLOAD
Message-ID: <
20030402020242.GA2966@ratsnest.hole>
p4raw-id: //depot/perl@19277
$got = "@got";
-my $expected = "attributes Carp Carp::Heavy DB Exporter Exporter::Heavy Internals main utf8 version warnings";
+my $expected = "attributes Carp Carp::Heavy DB Exporter Exporter::Heavy Internals main Regexp utf8 version warnings";
{
no strict 'vars';
@INC = qw(. ../lib);
}
-print "1..65\n";
+print "1..66\n";
require 'test.pl';
print "# expected \"$expect\", got \"$result\"\n";
}
+# bug #21347
+
+runperl(prog => 'sub UNIVERSAL::AUTOLOAD { qr// } a->p' );
+if ($? != 0) { print "not " };
+print "ok ",++$test," - UNIVERSAL::AUTOLOAD called when freeing qr//\n";
+
# test global destruction
++$test;
XS(XS_Internals_SvREFCNT);
XS(XS_Internals_hv_clear_placehold);
XS(XS_PerlIO_get_layers);
+XS(XS_Regexp_DESTROY);
void
Perl_boot_core_UNIVERSAL(pTHX)
XS_Internals_hv_clear_placehold, file, "\\%");
newXSproto("PerlIO::get_layers",
XS_PerlIO_get_layers, file, "*;@");
+ newXS("Regexp::DESTROY", XS_Regexp_DESTROY, file);
}
XSRETURN(0);
}
+XS(XS_Regexp_DESTROY)
+{
+
+}
+
XS(XS_PerlIO_get_layers)
{
dXSARGS;