summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-02-12 05:36:36 +0100
committerHugo van der Sanden <hv@crypt.org>2022-02-18 15:08:25 +0000
commitf08cf4076ad9433e9a9aa85b316dbb203517a353 (patch)
tree76e9d6254a81618993b1d1d6fa575ce6bc63f070 /regcomp.h
parent615094ef9383c35e9fb5760a1c6f3f1c92fedc5d (diff)
downloadperl-f08cf4076ad9433e9a9aa85b316dbb203517a353.tar.gz
regcomp.h: change regexp_internal attribute from I32 to U32
This changes the name_list_idx attribute from I32 to a U32 as it will never be negative, and as of a963d6d5acabdd8c7 a 0 can be safely used to represent "no value" for items in the 'data' array. I noticed this while cleaning up the offsets debug logic and updating the perlreguts documentation, so I figured I might as well clean it up at the same time.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/regcomp.h b/regcomp.h
index 6b8dc27642..2705463474 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -71,7 +71,10 @@ typedef struct regexp_internal {
strictly reserved for internal purposes. */
struct reg_code_blocks *code_blocks;/* positions of literal (?{}) */
U32 proglen; /* size of the compiled program in regnodes */
- int name_list_idx; /* Optional data index of an array of paren names */
+ U32 name_list_idx; /* Optional data index of an array of paren names,
+ only valid when RXp_PAREN_NAMES(prog) is true,
+ 0 means "no value" like any other index into the
+ data array.*/
regnode program[1]; /* Unwarranted chumminess with compiler. */
} regexp_internal;