aboutsummaryrefslogtreecommitdiff
path: root/lang/perl5.16/files/patch-bug52740
blob: 08a73a1547ee81930a0fea9756b1763d1ba686e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# http://rt.perl.org/rt3/Public/Bug/Display.html?id=52740
# http://perl5.git.perl.org/perl.git/commitdiff/785bee4f7cf89837cba8e6e0859abbb4b407e1f1?hp=90e91dd8c9549b16c38f6ab2e9fa25c7ea28dff8
diff --git a/sv.c b/sv.c
index f721e6f..5fcf018 100644
--- sv.c
+++ sv.c
@@ -3717,7 +3717,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV* sstr, const I32 flags)
 	    Perl_croak(aTHX_ "Cannot copy to %s", type);
     } else if (sflags & SVf_ROK) {
 	if (isGV_with_GP(dstr) && dtype == SVt_PVGV
-	    && SvTYPE(SvRV(sstr)) == SVt_PVGV) {
+	    && SvTYPE(SvRV(sstr)) == SVt_PVGV && isGV_with_GP(SvRV(sstr))) {
 	    sstr = SvRV(sstr);
 	    if (sstr == dstr) {
 		if (GvIMPORTED(dstr) != GVf_IMPORTED