Don't autogenerate the headers et alia,
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index 7fad9a4..daefb14 100644 (file)
--- a/op.c
+++ b/op.c
@@ -852,8 +852,14 @@ clear_pmop:
 #endif
        }
        cPMOPo->op_pmreplroot = Nullop;
-       ReREFCNT_dec(PM_GETRE(cPMOPo));
-       PM_SETRE(cPMOPo, (REGEXP*)NULL);
+        /* we use the "SAFE" version of the PM_ macros here
+         * since sv_clean_all might release some PMOPs
+         * after PL_regex_padav has been cleared
+         * and the clearing of PL_regex_padav needs to
+         * happen before sv_clean_all
+         */
+       ReREFCNT_dec(PM_GETRE_SAFE(cPMOPo));
+       PM_SETRE_SAFE(cPMOPo, (REGEXP*)NULL);
        break;
     }