save_gp(MUTABLE_GV(sv), !(PL_op->op_flags & OPf_SPECIAL));
if (sv && SvFAKE(sv)) {
SV *newsv = sv_newmortal();
- sv_setsv(newsv, sv);
+ sv_setsv_flags(newsv, sv, 0);
SvFAKE_off(newsv);
SETs(newsv);
}
/* case SVt_BIND: */
case SVt_PVLV:
case SVt_PVGV:
- if (isGV_with_GP(sstr) && dtype <= SVt_PVLV) {
- glob_assign_glob(dstr, sstr, dtype);
- return;
- }
/* SvVALID means that this PVGV is playing at being an FBM. */
- /*FALLTHROUGH*/
case SVt_PVMG:
if (SvGMAGICAL(sstr) && (flags & SV_GMAGIC)) {
mg_get(sstr);
if (SvTYPE(sstr) != stype)
stype = SvTYPE(sstr);
- if (isGV_with_GP(sstr) && dtype <= SVt_PVLV) {
+ }
+ if (isGV_with_GP(sstr) && dtype <= SVt_PVLV) {
glob_assign_glob(dstr, sstr, dtype);
return;
- }
}
if (stype == SVt_PVLV)
SvUPGRADE(dstr, SVt_PVNV);
@INC = '../lib';
}
-print "1..20\n";
+print "1..22\n";
my $t = 1;
tie my $c => 'Tie::Monitor';
$s = chop($c);
ok_string($s, '0', 1, 1);
+# Assignment should not ignore magic when the last thing assigned
+# was a glob
+$c = *strat;
+$s = $c;
+ok_string $s, *strat, 1, 1;
+
+
# adapted from Tie::Counter by Abigail
package Tie::Monitor;