Change 27336 by [EMAIL PROTECTED] on 2006/02/27 12:00:12

        Change 27330 failed to decontaminate SvCUR/GvFLAGS when upgrading an
        SvPV acting as a prototype placeholder to a full typeglob.

Affected files ...

... //depot/perl/gv.c#306 edit

Differences ...

==== //depot/perl/gv.c#306 (text) ====
Index: perl/gv.c
--- perl/gv.c#305~27334~        2006-02-27 03:06:30.000000000 -0800
+++ perl/gv.c   2006-02-27 04:00:12.000000000 -0800
@@ -162,7 +162,8 @@
 {
     dVAR;
     register GP *gp;
-    const bool doproto = SvTYPE(gv) > SVt_NULL;
+    const U32 old_type = SvTYPE(gv);
+    const bool doproto = old_type > SVt_NULL;
     const char * const proto = (doproto && SvPOK(gv)) ? SvPVX_const(gv) : NULL;
     SV *const has_constant = doproto && SvROK(gv) ? SvRV(gv) : NULL;
 
@@ -183,7 +184,12 @@
        SvROK_off(gv);
     }
 
-    sv_upgrade((SV*)gv, SVt_PVGV);
+
+    if (old_type < SVt_PVGV) {
+       if (old_type >= SVt_PV)
+           SvCUR_set(gv, 0);
+       sv_upgrade((SV*)gv, SVt_PVGV);
+    }
     if (SvLEN(gv)) {
        if (proto) {
            SvPV_set(gv, NULL);
End of Patch.

Reply via email to