Skip to content

Commit fb18145

Browse files
committed
regexec: do index arithmetic/comparison in unsigned mode
Otherwise gcc warns when building: In file included from perl.h:4229, from regexec.c:76: regexec.c: In function ‘S_isWB’: regexec.c:6276:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] 6276 | assert(index+1 < C_ARRAY_LENGTH(WB_dfa_table)); | ^ Fixes #23760.
1 parent 0f17f26 commit fb18145

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

regexec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6273,8 +6273,8 @@ S_isWB(pTHX_ WB_enum previous,
62736273
/* Here 'matched' is true if the DFA matched the input. If so,
62746274
* [index+1] contains the value to return */
62756275
if (matched) {
6276-
assert(index+1 < C_ARRAY_LENGTH(WB_dfa_table));
6277-
return WB_dfa_table[index+1];
6276+
assert(index+1u < C_ARRAY_LENGTH(WB_dfa_table));
6277+
return WB_dfa_table[index+1u];
62786278
}
62796279

62806280
/* Here, it didn't match. In [index+2] is stored the index into the

0 commit comments

Comments
 (0)