[libcxx] r322039 - Revert "Make rehash(0) work with ubsan's unsigned-integer-overflow."
Dan Albert via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 8 14:57:12 PST 2018
Author: danalbert
Date: Mon Jan 8 14:57:12 2018
New Revision: 322039
URL: http://llvm.org/viewvc/llvm-project?rev=322039&view=rev
Log:
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 7023194c8d11a081fd01ed25308b3d60193c6a06.
Modified:
libcxx/trunk/include/__hash_table
Modified: libcxx/trunk/include/__hash_table
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__hash_table?rev=322039&r1=322038&r2=322039&view=diff
==============================================================================
--- libcxx/trunk/include/__hash_table (original)
+++ libcxx/trunk/include/__hash_table Mon Jan 8 14:57:12 2018
@@ -2136,7 +2136,7 @@ template <class _Tp, class _Hash, class
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);
More information about the cfe-commits
mailing list