X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=op.c;h=daefb1493e1473bbd97572b9a179021db54f9be6;hb=b7711e741569c03e279a3607f6b4e22eb5665f90;hp=7fad9a41a0d115213fd1eaf5bfd6c7f6a2b4ba06;hpb=64420d0dad7f104a674beb20cf3622ce16388536;p=p5sagit%2Fp5-mst-13.2.git diff --git a/op.c b/op.c index 7fad9a4..daefb14 100644 --- 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; }