Declarations must come first, or some compilers aren't happy.
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index a3dee91..aeedab9 100644 (file)
--- a/op.c
+++ b/op.c
@@ -407,7 +407,7 @@ Perl_op_clear(pTHX_ OP *o)
 clear_pmop:
        {
            HV * const pmstash = PmopSTASH(cPMOPo);
-           if (pmstash && SvREFCNT(pmstash)) {
+           if (pmstash && !SvIS_FREED(pmstash)) {
                MAGIC * const mg = mg_find((SV*)pmstash, PERL_MAGIC_symtab);
                if (mg) {
                    PMOP *pmop = (PMOP*) mg->mg_obj;
@@ -4628,9 +4628,10 @@ Perl_newCONSTSUB(pTHX_ HV *stash, const char *name, SV *sv)
     CvCONST_on(cv);
     sv_setpvn((SV*)cv, "", 0);  /* prototype is "" */
 
+#ifdef USE_ITHREADS
     if (stash)
        CopSTASH_free(PL_curcop);
-
+#endif
     LEAVE;
 
     return cv;