summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-02-14 16:21:40 +0000
committerDavid Mitchell <davem@iabyn.com>2017-02-14 17:49:58 +0000
commitcbb658a1562fa3da6a29d865ee9b0ba564affb3f (patch)
tree589633f4573ab73fd953e474ec61366915b44de5 /regexec.c
parent4ee16520199a0e11bf4dbdbac71f0a64e5510271 (diff)
downloadperl-cbb658a1562fa3da6a29d865ee9b0ba564affb3f.tar.gz
Add a comment on why TRIE.jump does a UNWIND_PAREN
(it wasn't obvious to me)
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/regexec.c b/regexec.c
index e38365516e..f097e3e7de 100644
--- a/regexec.c
+++ b/regexec.c
@@ -5736,6 +5736,11 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
{
U8 *uc;
if ( ST.jump ) {
+ /* undo any captures done in the tail part of a branch,
+ * e.g.
+ * /(?:X(.)(.)|Y(.)).../
+ * where the trie just matches X then calls out to do the
+ * rest of the branch */
REGCP_UNWIND(ST.cp);
UNWIND_PAREN(ST.lastparen, ST.lastcloseparen);
}