summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1999-09-09 00:40:11 -0400
committerJarkko Hietaniemi <jhi@iki.fi>1999-09-09 09:05:32 +0000
commit2c914db612f0533f5da96e872ec005c73724c6fb (patch)
tree6be28793a009cedbffb268a51f7aba53cc2c7b61 /regexec.c
parenteda88b6dbdc5ca6a51d54f58740f0210e618beb7 (diff)
downloadperl-2c914db612f0533f5da96e872ec005c73724c6fb.tar.gz
Fix interaction of (?p{}) and (?>)
To: perl5-porters@perl.org (Mailing list Perl5) Message-Id: <199909090840.EAA26471@monk.mps.ohio-state.edu> p4raw-id: //depot/cfgperl@4112
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/regexec.c b/regexec.c
index 54f5e22253..83611450d2 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2162,6 +2162,20 @@ S_regmatch(pTHX_ regnode *prog)
PL_reg_maxiter = 0;
if (regmatch(re->program + 1)) {
+ /* Even though we succeeded, we need to restore
+ global variables, since we may be wrapped inside
+ SUSPEND, thus the match may be not finished yet. */
+
+ /* XXXX Do this only if SUSPENDed? */
+ PL_reg_call_cc = state.prev;
+ PL_regcc = state.cc;
+ PL_reg_re = state.re;
+ cache_re(PL_reg_re);
+
+ /* XXXX This is too dramatic a measure... */
+ PL_reg_maxiter = 0;
+
+ /* These are needed even if not SUSPEND. */
ReREFCNT_dec(re);
regcpblow(cp);
sayYES;