This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [perl #22719] ISA cache problem with blessed stash objects
authorDave Mitchell <davem@fdisolutions.com>
Tue, 24 Jun 2003 13:16:18 +0000 (14:16 +0100)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 24 Jun 2003 17:32:37 +0000 (17:32 +0000)
Message-ID: <20030624121618.GC22675@fdgroup.com>

p4raw-id: //depot/perl@19849

sv.c
t/op/ref.t

diff --git a/sv.c b/sv.c
index 7be1585..f001497 100644 (file)
--- 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
index d4c290e..3bb280c 100755 (executable)
@@ -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;