diff options
author | Yves Orton <demerphq@gmail.com> | 2008-12-27 20:19:31 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2008-12-27 20:19:31 +0100 |
commit | 6962fb1a1ff5ac2ee529f793d9ff033a7525ff4d (patch) | |
tree | e14d65ec1639cb2896e436ce0fd1a363cf4c1912 /regexec.c | |
parent | b7e5ec797d6492ead4bf7f40925d2bf6a2f5b0df (diff) | |
download | perl-6962fb1a1ff5ac2ee529f793d9ff033a7525ff4d.tar.gz |
fix bug #57042 - preserve $^R across TRIE matches
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |