summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2023-01-09 20:49:12 +0100
committerYves Orton <demerphq@gmail.com>2023-01-11 14:28:33 +0100
commit3f11a2855248134af98ca8d71cf71a3fe736dbae (patch)
tree7938935c782a5aabed1b392f3b841906d91e167c /regcomp.c
parent67244d99e1ad05ddedabc8d640ceaf1d5b8e259d (diff)
downloadperl-3f11a2855248134af98ca8d71cf71a3fe736dbae.tar.gz
regexec engine - wrap and replace RX_OFFS() with better abstractions
RX_OFFS() exposes a bit too much about how capture buffers are represented. This adds RX_OFFS_START() and RX_OFFS_END() and RX_OFFS_VALID() to replace most of the uses of the RX_OFFS() macro or direct access to the rx->off[] array. (We add RX_OFFSp() for those rare cases that should have direct access to the array.) This allows us to replace this logic with more complicated macros in the future. Pretty much anything using RX_OFFS() is going to be broken by future changes, so changing the define allows us to track it down easily. Not all use of the rx->offs[] array are converted; some uses are required for the regex engine internals, but anything outside of the regex engine should be using the replacement macros, and most things in the regex internals should use it also.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index f98304daf3..3f404bddde 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -15718,9 +15718,9 @@ S_handle_names_wildcard(pTHX_ const char * wname, /* wildcard name to match */
* so we could match anywhere in that string. We have to rule out
* matching a code point line */
char * this_name_start = all_names_start
- + RX_OFFS(subpattern_re)->start;
+ + RX_OFFS_START(subpattern_re,0);
char * this_name_end = all_names_start
- + RX_OFFS(subpattern_re)->end;
+ + RX_OFFS_END(subpattern_re,0);
char * cp_start;
char * cp_end;
UV cp = 0; /* Silences some compilers */