summaryrefslogtreecommitdiff
path: root/regcomp.sym
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2023-01-14 14:38:38 +0100
committerYves Orton <demerphq@gmail.com>2023-03-13 21:26:08 +0800
commit59db194299c94c6707095797c3df0e2f67ff82b2 (patch)
treec016d5aabc09854ca74f22570efe64a72847018b /regcomp.sym
parent38508ce8fc3a1bd12a3bb65e9d4ceb9b396a18db (diff)
downloadperl-59db194299c94c6707095797c3df0e2f67ff82b2.tar.gz
regexec.c - make REF into a backtracking state
This way we can do the required paren restoration only when it is in use. When we match a REF type node which is potentially a reference to an unclosed paren we push the match context information, currently for "everything", but in a future patch we can teach it to be more efficient by adding a new parameter to the REF regop to track which parens it should save. This converts the backtracking changes from the previous commit, so that it is run only when specifically enabled via the define RE_PESSIMISTIC_PARENS which is by default 0. We don't make the new fields in the struct conditional as the stack frames are large and our changes don't make any real difference and it keeps things simpler to not have conditional members, especially since some of the structures have to line up with each other. If enabling RE_PESSIMISTIC_PARENS fixes a backtracking bug then it means something is sensitive to us not necessarily restoring the parens properly on failure. We make some assumptions that the paren state after a failing state will be corrected by a future successful state, or that the state of the parens is irrelevant as we will fail anyway. This can be made not true by EVAL, backrefs, and potentially some other scenarios. Thus I have left this inefficient logic in place but guarded by the flag.
Diffstat (limited to 'regcomp.sym')
-rw-r--r--regcomp.sym1
1 files changed, 1 insertions, 0 deletions
diff --git a/regcomp.sym b/regcomp.sym
index e01844f9b0..d58f1cb54f 100644
--- a/regcomp.sym
+++ b/regcomp.sym
@@ -344,3 +344,4 @@ MARKPOINT next:FAIL
SKIP next:FAIL
CUTGROUP next:FAIL
KEEPS next:FAIL
+REF next:FAIL