On Windows with MSVC, the implementation of StringSearch<Char>::BoyerMooreHorspoolSearch emits a concerning warning.
Code:
|
const size_t pattern_length = pattern_.length(); |
|
int* char_occurrences = bad_char_shift_table_; |
|
int64_t badness = -pattern_length; |
The emitted warning is C4146: unary minus operator applied to unsigned type, result still unsigned
This looks like it introduces a bug in the function, at least on Windows, because badness is never going to be a negative number.
On Windows with MSVC, the implementation of
StringSearch<Char>::BoyerMooreHorspoolSearchemits a concerning warning.Code:
node/src/string_search.h
Lines 459 to 461 in fd02dac
The emitted warning is C4146: unary minus operator applied to unsigned type, result still unsigned
This looks like it introduces a bug in the function, at least on Windows, because
badnessis never going to be a negative number.