A couple of File::Path tests require unix syntax on VMS.
[p5sagit/p5-mst-13.2.git] / scope.c
diff --git a/scope.c b/scope.c
index 4b68f1b..c9700b3 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -261,6 +261,14 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty)
            gp->gp_io = newIO();
            IoFLAGS(gp->gp_io) |= IOf_ARGV|IOf_START;
        }
+#ifdef PERL_DONT_CREATE_GVSV
+       if (gv == PL_errgv) {
+           /* We could scatter this logic everywhere by changing the
+              definition of ERRSV from GvSV() to GvSVn(), but it seems more
+              efficient to do this check once here.  */
+           gp->gp_sv = newSV(0);
+       }
+#endif
        GvGP(gv) = gp;
     }
     else {
@@ -545,7 +553,7 @@ Perl_save_helem(pTHX_ HV *hv, SV *key, SV **sptr)
     SvGETMAGIC(*sptr);
     SSCHECK(4);
     SSPUSHPTR(SvREFCNT_inc_simple(hv));
-    SSPUSHPTR(SvREFCNT_inc_simple(key));
+    SSPUSHPTR(newSVsv(key));
     SSPUSHPTR(SvREFCNT_inc(*sptr));
     SSPUSHINT(SAVEt_HELEM);
     save_scalar_at(sptr);