From: Dave Mitchell Date: Tue, 24 Jun 2003 13:16:18 +0000 (+0100) Subject: Re: [perl #22719] ISA cache problem with blessed stash objects X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=23bb1b96cfae0dc23679ea6dd44cf0deadeb9fbf;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #22719] ISA cache problem with blessed stash objects Message-ID: <20030624121618.GC22675@fdgroup.com> p4raw-id: //depot/perl@19849 --- diff --git a/sv.c b/sv.c index 7be1585..f001497 100644 --- a/sv.c +++ b/sv.c @@ -3673,7 +3673,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags) if (dtype < SVt_RV) sv_upgrade(dstr, SVt_RV); else if (dtype == SVt_PVGV && - SvTYPE(SvRV(sstr)) == SVt_PVGV) { + SvROK(sstr) && SvTYPE(SvRV(sstr)) == SVt_PVGV) { sstr = SvRV(sstr); if (sstr == dstr) { if (GvIMPORTED(dstr) != GVf_IMPORTED diff --git a/t/op/ref.t b/t/op/ref.t index d4c290e..3bb280c 100755 --- a/t/op/ref.t +++ b/t/op/ref.t @@ -5,7 +5,7 @@ BEGIN { @INC = qw(. ../lib); } -print "1..67\n"; +print "1..68\n"; require 'test.pl'; @@ -350,6 +350,14 @@ runperl(prog => 'sub UNIVERSAL::DESTROY { warn } bless \$a, A', stderr => 1); if ($? != 0) { print "not " }; print "ok ",++$test," - warn called inside UNIVERSAL::DESTROY\n"; + +# bug #22719 + +runperl(prog => 'sub f { my $x = shift; *z = $x; } f({}); f();'); +if ($? != 0) { print "not " }; +print "ok ",++$test," - coredump on typeglob = (SvRV && !SvROK)\n"; + + # test global destruction ++$test;