From: Nicholas Clark Date: Thu, 21 Aug 2008 21:47:14 +0000 (+0000) Subject: Change 33807 to fix bug #52740 wasn't quite right, as it ended up with X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=785bee4f7cf89837cba8e6e0859abbb4b407e1f1;p=p5sagit%2Fp5-mst-13.2.git Change 33807 to fix bug #52740 wasn't quite right, as it ended up with unitialised reads (and sometimes even SEGVs). p4raw-id: //depot/perl@34213 --- diff --git a/sv.c b/sv.c index f721e6f..5fcf018 100644 --- a/sv.c +++ b/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 @@ -3728,10 +3728,8 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV* sstr, const I32 flags) GvMULTI_on(dstr); return; } - if (isGV_with_GP(sstr)) { - glob_assign_glob(dstr, sstr, dtype); - return; - } + glob_assign_glob(dstr, sstr, dtype); + return; } if (dtype >= SVt_PV) {