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
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) {