summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--op.c5
-rw-r--r--regexec.c2
-rw-r--r--sv.c3
3 files changed, 5 insertions, 5 deletions
diff --git a/op.c b/op.c
index af52a3a06c..2423bf0824 100644
--- a/op.c
+++ b/op.c
@@ -624,7 +624,8 @@ clear_pmop:
#ifdef USE_ITHREADS
if(PL_regex_pad) { /* We could be in destruction */
ReREFCNT_dec(PM_GETRE(cPMOPo));
- av_push((AV*) PL_regex_pad[0],(SV*) PL_regex_pad[(cPMOPo)->op_pmoffset]);
+ av_push((AV*) PL_regex_pad[0],
+ (SV*) SvREFCNT_inc_simple_NN(PL_regex_pad[(cPMOPo)->op_pmoffset]));
SvREADONLY_off(PL_regex_pad[(cPMOPo)->op_pmoffset]);
SvREPADTMP_on(PL_regex_pad[(cPMOPo)->op_pmoffset]);
PM_SETRE_OFFSET(cPMOPo, (cPMOPo)->op_pmoffset);
@@ -3373,7 +3374,7 @@ Perl_newPMOP(pTHX_ I32 type, I32 flags)
sv_setiv(repointer,0);
} else {
SV * const repointer = newSViv(0);
- av_push(PL_regex_padav, SvREFCNT_inc_simple_NN(repointer));
+ av_push(PL_regex_padav, repointer);
pmop->op_pmoffset = av_len(PL_regex_padav);
PL_regex_pad = AvARRAY(PL_regex_padav);
}
diff --git a/regexec.c b/regexec.c
index 26c7a1af52..9588cdfd12 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2259,7 +2259,7 @@ S_regtry(pTHX_ regmatch_info *reginfo, char **startpos)
/* so we know which PL_regex_padav element is PL_reg_curpm
when clearing up in perl_destruct() */
SvFLAGS(repointer) |= SVf_BREAK;
- av_push(PL_regex_padav,repointer);
+ av_push(PL_regex_padav,SvREFCNT_inc_simple_NN(repointer));
PL_reg_curpm->op_pmoffset = av_len(PL_regex_padav);
PL_regex_pad = AvARRAY(PL_regex_padav);
}
diff --git a/sv.c b/sv.c
index db635955b4..f8e18a9e05 100644
--- a/sv.c
+++ b/sv.c
@@ -11273,8 +11273,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
SV * const sv =
SvREPADTMP(regex)
? sv_dup_inc((SV*) regex, param)
- : SvREFCNT_inc(
- newSViv(PTR2IV(sv_dup_inc(INT2PTR(SV *, SvIVX(regex)), param))))
+ : newSViv(PTR2IV(sv_dup_inc(INT2PTR(SV *, SvIVX(regex)), param)))
;
if (SvFLAGS(regex) & SVf_BREAK)
SvFLAGS(sv) |= SVf_BREAK; /* unrefcnted PL_curpm */