dtype = SvTYPE(dstr);
SvAMAGIC_off(dstr);
+ if ( SvVOK(dstr) )
+ {
+ /* need to nuke the magic */
+ mg_free(dstr);
+ SvRMAGICAL_off(dstr);
+ }
/* There's a lot of redundancy below but we're going for speed here */
SvIVX(dstr) = SvIVX(sstr);
}
if (SvVOK(sstr)) {
- MAGIC *mg = SvMAGIC(sstr);
- sv_magicext(dstr, NULL, PERL_MAGIC_vstring, NULL,
- mg->mg_ptr, mg->mg_len);
+ MAGIC *smg = mg_find(sstr,PERL_MAGIC_vstring);
+ sv_magic(dstr, NULL, PERL_MAGIC_vstring,
+ smg->mg_ptr, smg->mg_len);
SvRMAGICAL_on(dstr);
}
}
case PERL_MAGIC_vec:
vtable = &PL_vtbl_vec;
break;
+ case PERL_MAGIC_vstring:
+ vtable = 0;
+ break;
case PERL_MAGIC_substr:
vtable = &PL_vtbl_substr;
break;
pos++;
}
SvPOK_on(sv);
- sv_magicext(sv,NULL,PERL_MAGIC_vstring,NULL,(const char*)start, pos-start);
+ sv_magic(sv,NULL,PERL_MAGIC_vstring,(const char*)start, pos-start);
SvRMAGICAL_on(sv);
}
return s;