Recalculate dstr in Perl_sv_setsv_flags, as dstr may have been upgraded.
Nicholas Clark [Thu, 23 Feb 2006 13:42:29 +0000 (13:42 +0000)]
p4raw-id: //depot/perl@27282

sv.c

diff --git a/sv.c b/sv.c
index ffe3772..5b63207 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -3456,6 +3456,8 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
            SvUPGRADE(dstr, (U32)stype);
     }
 
+    /* dstr may have been upgraded.  */
+    dtype = SvTYPE(dstr);
     sflags = SvFLAGS(sstr);
 
     if (sflags & SVf_ROK) {