<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63822>63822</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libcxx] Lookup array size in _BMSkipTable for std::boyer_moore_horspool_searcher is not sufficient
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ibmibmibm
</td>
</tr>
</table>
<pre>
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.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVN1uozwQfRpzM0oEdkLIBRdJ2uj71F1ppVZ7i4wZgjfGRrZpwz79ypC_NpUsgcdzzpz5sblz8qARc7LckuVTxHvfGJvLsp1WVJpqyP_XQNJYaqH6Cgnd46lDK1vUnitC93WvhZdGc6UI2ySrBUljwjYkfiLxJvyPSxC6DWuy0j2he4DXDoXkCgR3CK7lSoHuW7RSwDtXPTrCttA7BK6BW8uHCe6x7RT3SNhOKO4cFC84ELoDP3SoeYtQ_A7wYDo7_Mddc7fdSs3t8MtiJcVI9DwxX45_vh5l98ZLFWJc2G-kV7oHoiDC9oEQyOqcbWfl-xjkXBMAGJVWWJ85p2yLYCTsjLq5vOAAAEccPjs8kl3Tb_kRi16Pza0I292wz0EF24QNXByKB-p7UuerCTM1gO3utNLdpV-Fkq30jrDdN6znoC0_EZoRug7VcUfZFS3vPsW8GKEo_FT87ZcxmrZvDYaRvEZIY8Agi3sEb8KRaLgN7qEfTe_AT4gHtd-I-0JGl8vA8tFI0YB0oNC5WTnMjEaojQVhrEXhp_kEJ_8i0GU6j6qcVWu25hHmSZqtk2UWp0nU5BzrqmQrpDWL0zRdVxjjOmNxnS6ybJWUkcxpTFm8SmgSswVN5mtOF6uYZYukzEqkSBYxtlyquVLv7dzYQySd6zFPWUZppHiJyo03mlKNHzAeEkrDBbd5wMzK_uDIIlbSeXdj8dKr8SlQshSnE1k-wQ9jjn13n5vUn67HWILriJRmQFu0xlgsGmNdZ4wqHHIrGrSheNp4cH1dSyFR-6i3Km-871yAj2_CQfqmL-fCtITug7LzZ9ZZ8weFJ3Q_5uMI3Y_5_gsAAP___M-GPg">