summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
Diffstat (limited to 'op.c')
-rw-r--r--op.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/op.c b/op.c
index 9410bf0d37..3903f53bb1 100644
--- a/op.c
+++ b/op.c
@@ -624,10 +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*) SvREFCNT_inc_simple_NN(PL_regex_pad[(cPMOPo)->op_pmoffset]));
- SvREADONLY_off(PL_regex_pad[(cPMOPo)->op_pmoffset]);
- PM_SETRE_OFFSET(cPMOPo, (cPMOPo)->op_pmoffset);
+ av_push((AV*) PL_regex_pad[0], newSViv((cPMOPo)->op_pmoffset));
+ PL_regex_pad[(cPMOPo)->op_pmoffset] = &PL_sv_undef;
}
#else
ReREFCNT_dec(PM_GETRE(cPMOPo));
@@ -3370,12 +3368,11 @@ Perl_newPMOP(pTHX_ I32 type, I32 flags)
SV * const repointer = av_pop((AV*)PL_regex_pad[0]);
const IV offset = SvIV(repointer);
pmop->op_pmoffset = offset;
- SvOK_off(repointer);
- assert(repointer == PL_regex_pad[offset]);
- /* One reference remains, in PL_regex_pad[offset] */
+ /* This slot should be free, so assert this: */
+ assert(PL_regex_pad[offset] == &PL_sv_undef);
SvREFCNT_dec(repointer);
} else {
- SV * const repointer = newSViv(0);
+ SV * const repointer = &PL_sv_undef;
av_push(PL_regex_padav, repointer);
pmop->op_pmoffset = av_len(PL_regex_padav);
PL_regex_pad = AvARRAY(PL_regex_padav);