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.
struct reg_data *data;
struct reg_code_blocks *code_blocks;
U32 proglen;
- int name_list_idx;
+ U32 name_list_idx;
regnode program[1];
} regexp_internal;
This is the index into the data array where an AV is stored that contains
the names of any named capture buffers in the pattern, should there be
-any. This is only used in the debugging version of the regex engine. It
-will be 0 if there is no such data.
+any. This is only used in the debugging version of the regex engine and
+when RXp_PAREN_NAMES(prog) is true. It will be 0 if there is no such data.
=item C<program>
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;