amagic. Now check for that and allocate the tmpsv afterwards,
this is done in all other places that use amagic.
Fixes bug when threads->unknownfunction() was called and
we coredumped on the stringification somewhere deep in the
autoloader/dynaloader something. Far to deep for me to provide
a test case.
p4raw-id: //depot/perl@16558
void
Perl_sv_copypv(pTHX_ SV *dsv, register SV *ssv)
{
- SV *tmpsv = sv_newmortal();
+ SV *tmpsv;
- if ( SvTHINKFIRST(ssv) && SvROK(ssv) && SvAMAGIC(ssv) ) {
- tmpsv = AMG_CALLun(ssv,string);
+ if ( SvTHINKFIRST(ssv) && SvROK(ssv) && SvAMAGIC(ssv) &&
+ (tmpsv = AMG_CALLun(ssv,string))) {
if (SvTYPE(tmpsv) != SVt_RV || (SvRV(tmpsv) != SvRV(ssv))) {
SvSetSV(dsv,tmpsv);
return;
}
+ } else {
+ tmpsv = sv_newmortal();
}
{
STRLEN len;