Skip to content

Commit a5e9751

Browse files
committed
regexec.c: Silence solaris compiler warning
This is using a signed value that should be set non-negative before it gets to these places.
1 parent f151643 commit a5e9751

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

regexec.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5017,8 +5017,8 @@ S_setup_EXACTISH_ST(pTHX_ const regnode * const text_node,
50175017

50185018
/* Add this character to the list of possible matches */
50195019
if (utf8_target) {
5020-
uv_to_utf8(matches[(U8) m->count], fold_from);
5021-
lengths[m->count] = UVCHR_SKIP(fold_from);
5020+
uv_to_utf8(matches[ (PERL_UINT_FAST8_T) m->count ], fold_from);
5021+
lengths[ (PERL_UINT_FAST8_T) m->count ] = UVCHR_SKIP(fold_from);
50225022
m->count++;
50235023
}
50245024
else { /* Non-UTF8 target: no code point above 255 can appear in it
@@ -5027,17 +5027,17 @@ S_setup_EXACTISH_ST(pTHX_ const regnode * const text_node,
50275027
continue;
50285028
}
50295029

5030-
matches[m->count][0] = fold_from;
5031-
lengths[m->count] = 1;
5030+
matches[ (PERL_UINT_FAST8_T) m->count ][0] = fold_from;
5031+
lengths[ (PERL_UINT_FAST8_T) m->count ] = 1;
50325032
m->count++;
50335033
}
50345034

50355035
/* Update min and mlengths */
5036-
if (m->min_length > lengths[m->count-1]) {
5037-
m->min_length = lengths[m->count-1];
5036+
if (m->min_length > lengths[ (PERL_UINT_FAST8_T) m->count - 1 ]) {
5037+
m->min_length = lengths[ (PERL_UINT_FAST8_T) m->count - 1 ];
50385038
}
50395039

5040-
if (m->max_length < lengths[m->count-1]) {
5040+
if (m->max_length < lengths[ (PERL_UINT_FAST8_T) m->count - 1 ]) {
50415041
index_of_longest = m->count - 1;
50425042
m->max_length = lengths[index_of_longest];
50435043
}

0 commit comments

Comments
 (0)