summaryrefslogtreecommitdiff
path: root/regcomp.sym
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-02-20 10:38:09 +0100
committerKarl Williamson <khw@cpan.org>2022-02-23 10:40:52 -0700
commit271c3af797311222713e1573330fe45bb5609e6a (patch)
treec3657135c131acece6870b65353ee8ee64ef0760 /regcomp.sym
parent35b3c2dce3f9235087a5114ea0abb1d6200b534a (diff)
downloadperl-271c3af797311222713e1573330fe45bb5609e6a.tar.gz
regex engine: Issue #19168 - Fix variable length lookbehind matches
We were not validating that when (?<=a|ab) matched that the right hand side of the match lined up with the position of the assertion. Similar for (?<!a|ab) and related patterns, eg, (*positive_lookbehind:). Note these problems do NOT affect lookahead. Part of the difficulty here was that the SUCCEED node was serving too many purposes, necessitating a new regop LOOKBEHIND_END. Includes more tests for various lookahead or lookbehind cases.
Diffstat (limited to 'regcomp.sym')
-rw-r--r--regcomp.sym3
1 files changed, 3 insertions, 0 deletions
diff --git a/regcomp.sym b/regcomp.sym
index 510a6162be..bdf6e47551 100644
--- a/regcomp.sym
+++ b/regcomp.sym
@@ -282,6 +282,9 @@ CUTGROUP VERB, no-sv 1 ; On failure go to the next alternation in the
#*Control what to keep in $&.
KEEPS KEEPS, no ; $& begins here.
+#*Validate that lookbehind IFMATCH and UNLESSM end at the right place
+LOOKBEHIND_END END, no ; Return from lookbehind (IFMATCH/UNLESSM) and validate position
+
# NEW STUFF SOMEWHERE ABOVE THIS LINE. Stuff that regexec.c: find_byclass()
# and regrepeat() use should go way above, near LNBREAK to allow a more compact
# jump table to be generated for their switch() statements