summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index 6c0923fc8b..f959121b81 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3003,7 +3003,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog)
if ( got_wordnum ) {
if ( ! ST.accepted ) {
ENTER;
- /* SAVETMPS; */ /* XXX is this necessary? dmq */
+ SAVETMPS; /* XXX is this necessary? dmq */
bufflen = TRIE_INITAL_ACCEPT_BUFFLEN;
sv_accept_buff=newSV(bufflen *
sizeof(reg_trie_accepted) - 1);
@@ -3222,6 +3222,9 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog)
}
/* NOTREACHED */
case TRIE_next:
+ /* we dont want to throw this away, see bug 57042*/
+ if (oreplsv != GvSV(PL_replgv))
+ sv_setsv(oreplsv, GvSV(PL_replgv));
FREETMPS;
LEAVE;
sayYES;