| Issue |
63822
|
| Summary |
[libcxx] Lookup array size in _BMSkipTable for std::boyer_moore_horspool_searcher is not sufficient
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
ibmibmibm
|
In `include/experimental/functionall:174`:
```c++
// Special case small numeric values; use an array
template<class _Key, typename _Value, class _Hash, class _BinaryPredicate>
class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, true> {
private:
typedef _Value value_type;
typedef _Key key_type;
typedef typename make_unsigned<key_type>::type unsigned_key_type;
typedef std::array<value_type, numeric_limits<unsigned_key_type>::max()> skip_map;
skip_map __table;
```
The `key_type` evaluate to `char`, thus the `numeric_limits<>::max()` evaluate to 255, which is less-by-one for correct array size 256.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs