[win32] apply missing pieces from:
Chip Salzenberg [Thu, 27 Nov 1997 15:44:02 +0000 (10:44 -0500)]
Message-Id: <199711272044.PAA12102@nielsenmedia.com>
Subject: [PATCH] Improved LVALUE patch

p4raw-id: //depot/win32/perl@609

sv.c

diff --git a/sv.c b/sv.c
index 8bb6c14..2c5f4df 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -1939,7 +1939,6 @@ sv_setsv(SV *dstr, register SV *sstr)
        if (dtype < SVt_PVNV)
            sv_upgrade(dstr, SVt_PVNV);
        break;
-
     case SVt_PVAV:
     case SVt_PVHV:
     case SVt_PVCV:
@@ -1990,8 +1989,10 @@ sv_setsv(SV *dstr, register SV *sstr)
                    goto glob_assign;
            }
        }
-       if (dtype < stype)
-           sv_upgrade(dstr, stype);
+       if (stype == SVt_PVLV)
+           SvUPGRADE(dstr, SVt_PVNV);
+       else
+           SvUPGRADE(dstr, stype);
     }
 
     sflags = SvFLAGS(sstr);