From: Artur Bergman Date: Sun, 12 May 2002 17:57:51 +0000 (+0000) Subject: Fixed bug where tmpsv would be null after the return of the X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d40b16338e2bea9bcea6aeaf36a63ed755d0b747;p=p5sagit%2Fp5-mst-13.2.git Fixed bug where tmpsv would be null after the return of the 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 --- diff --git a/sv.c b/sv.c index 7e6bc2d..13b548b 100644 --- a/sv.c +++ b/sv.c @@ -3192,14 +3192,16 @@ would lose the UTF-8'ness of the PV. 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;