perlcheat is a reference, not tutorial.
[p5sagit/p5-mst-13.2.git] / sv.c
diff --git a/sv.c b/sv.c
index 1b76e02..c93c0ea 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -5309,6 +5309,7 @@ Perl_sv_replace(pTHX_ register SV *sv, register SV *nsv)
 #endif
     SvREFCNT(sv) = refcnt;
     SvFLAGS(nsv) |= SVTYPEMASK;                /* Mark as freed */
+    SvREFCNT(nsv) = 0;
     del_SV(nsv);
 }
 
@@ -6625,7 +6626,7 @@ thats_really_all_folks:
        /*The big, slow, and stupid way. */
 
       /* Any stack-challenged places. */
-#if defined(EPOC) || 1
+#if defined(EPOC)
       /* EPOC: need to work around SDK features.         *
        * On WINS: MS VC5 generates calls to _chkstk,     *
        * if a "large" stack frame is allocated.          *
@@ -7378,6 +7379,7 @@ Perl_sv_reset(pTHX_ register char *s, HV *stash)
                }
                if (GvHV(gv) && !HvNAME(GvHV(gv))) {
                    hv_clear(GvHV(gv));
+#ifndef PERL_MICRO
 #ifdef USE_ENVIRON_ARRAY
                    if (gv == PL_envgv
 #  ifdef USE_ITHREADS
@@ -7388,6 +7390,7 @@ Perl_sv_reset(pTHX_ register char *s, HV *stash)
                        environ[0] = Nullch;
                    }
 #endif
+#endif /* !PERL_MICRO */
                }
            }
        }