Revert "Make rehash(0) work with ubsan's unsigned-integer-overflow."
Seems to have broken some tests since I first wrote this a while
back. Will reland after checking what went wrong with the tests.
This reverts commit 7023194c8d.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@322039 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2136,7 +2136,7 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
||||
void
|
||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::rehash(size_type __n)
|
||||
{
|
||||
if (__n < 2)
|
||||
if (__n == 1)
|
||||
__n = 2;
|
||||
else if (__n & (__n - 1))
|
||||
__n = __next_prime(__n);
|
||||
|
||||
Reference in New Issue
Block a user